Line up the borders to reduce gaps
Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
parent
7e7b016a70
commit
dbedd9bacb
@ -22,7 +22,8 @@ const Board = ({ game }) => {
|
||||
tileHeight = tileWidth * hexRatio,
|
||||
tileHalfHeight = tileHeight * 0.5,
|
||||
radius = tileHeight * 2,
|
||||
borderOffset = 86; /* ~1/10th border image width... hand tuned */
|
||||
borderOffsetX = 86, /* ~1/10th border image width... hand tuned */
|
||||
borderOffsetY = 3;
|
||||
|
||||
/* Actual sizing */
|
||||
const
|
||||
@ -286,7 +287,7 @@ const Board = ({ game }) => {
|
||||
return game.borderOrder.map(order => {
|
||||
const border = game.borders[order];
|
||||
side++;
|
||||
let x = Math.sin(Math.PI - side / sides * 2. * Math.PI) * radius,
|
||||
let x = + Math.sin(Math.PI - side / sides * 2. * Math.PI) * radius,
|
||||
y = Math.cos(Math.PI - side / sides * 2. * Math.PI) * radius;
|
||||
let prev = (order === 0) ? 6 : order;
|
||||
const file = `borders-${order+1}.${prev}.png`;
|
||||
@ -299,7 +300,7 @@ const Board = ({ game }) => {
|
||||
height: `${borderImageHeight}px`,
|
||||
top: `${y}px`,
|
||||
left: `${x}px`,
|
||||
transform: `rotate(${side*(360/sides)}deg) translate(${borderOffset}px, 0) scale(-1, -1)`,
|
||||
transform: `rotate(${side*(360/sides)}deg) translate(${borderOffsetX}px, ${borderOffsetY}px) scale(-1, -1)`,
|
||||
backgroundImage: `url(${assetsPath}/gfx/${file} )`
|
||||
}}
|
||||
/>;
|
||||
|
Loading…
x
Reference in New Issue
Block a user