diff --git a/src/video-grid/model.ts b/src/video-grid/model.ts index 5150acef..15973c41 100644 --- a/src/video-grid/model.ts +++ b/src/video-grid/model.ts @@ -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([from]); const rows = row(g.cells.length - 1, g) + 1; diff --git a/test/video-grid/model-test.ts b/test/video-grid/model-test.ts index f7d03309..479f9cb1 100644 --- a/test/video-grid/model-test.ts +++ b/test/video-grid/model-test.ts @@ -273,9 +273,9 @@ dbbe fghi jk`, ` -abhc -djge -fik` +akbc +djhe +fig` ); testCycleTileSize(