Fix tiles not collapsing toward their center

This commit is contained in:
Robin Townsend 2023-06-18 00:58:54 -04:00
parent 391ba5196c
commit 4e5a75074a
2 changed files with 5 additions and 5 deletions

View file

@ -543,8 +543,8 @@ export function cycleTileSize(tileId: string, g: Grid): Grid {
// To make the tile appear to expand outwards from its center, we're actually
// scanning for locations to put the *center* of the tile. These numbers are
// the offsets between the tile's origin and its center.
const scanColumnOffset = Math.floor((toWidth - 1) / 2);
const scanRowOffset = Math.floor((toHeight - 1) / 2);
const scanColumnOffset = Math.floor((toWidth - fromWidth) / 2);
const scanRowOffset = Math.floor((toHeight - fromHeight) / 2);
const nextScanLocations = new Set<number>([from]);
const rows = row(g.cells.length - 1, g) + 1;

View file

@ -273,9 +273,9 @@ dbbe
fghi
jk`,
`
abhc
djge
fik`
akbc
djhe
fig`
);
testCycleTileSize(