From 61f109eb37d7fee9532d029ce9a3d111cc5cfd8a Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 23 May 2022 17:56:43 +0200 Subject: Tweak cylinder layout. --- pieces/cylinder_black.svg | 2 +- play.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pieces/cylinder_black.svg b/pieces/cylinder_black.svg index b934b0f..e36ad02 100644 --- a/pieces/cylinder_black.svg +++ b/pieces/cylinder_black.svg @@ -1,5 +1,5 @@ - + diff --git a/play.js b/play.js index df535e0..99c6f66 100644 --- a/play.js +++ b/play.js @@ -434,7 +434,7 @@ function layout_tribes_radial(list, xc, yc, maxcol) { ui.pieces[i].style = `top:${Math.round(y)}px;left:${Math.round(x)}px`; } let angle = 2 * Math.PI / Math.max(list.length, 7); - let phase = (list.length - 1) * angle / 2; + let phase = (list.length <= 3) ? Math.PI * 2 / 7 : (list.length - 1) * angle / 2; for (let i = 0; i < list.length; ++i) { let x = xc + Math.sin(i * angle - phase) * 46 - 14; let y = yc - Math.cos(i * angle - phase) * 44 - 14; @@ -694,7 +694,7 @@ function on_update() { layout_region_armies(Herat, 454, 458, 6); layout_region_armies(Kabul, 671, 238, 8); layout_region_armies(Kandahar, 730, 477, 5); - layout_region_armies(Punjab, 928, 381, 3); + layout_region_armies(Punjab, 928+10, 381, 4); layout_region_tribes(Persia, 204, 426, 5); layout_region_tribes(Transcaspia, 252, 152+5, 10); -- cgit v1.2.3