From 374c68e3c053cd103e849d6db3cc57b990de31be Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Sun, 5 Feb 2023 01:17:28 -0500 Subject: [PATCH] Fix tiles enlarging to the wrong place on mobile --- src/video-grid/NewVideoGrid.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video-grid/NewVideoGrid.tsx b/src/video-grid/NewVideoGrid.tsx index b4d13fc0..d22ad6e2 100644 --- a/src/video-grid/NewVideoGrid.tsx +++ b/src/video-grid/NewVideoGrid.tsx @@ -130,7 +130,8 @@ const findLast1By1Index = (g: Grid): number | null => findLastIndex(g.cells, (c) => c?.rows === 1 && c?.columns === 1); const row = (index: number, g: Grid): number => Math.floor(index / g.columns); -const column = (index: number, g: Grid): number => index % g.columns; +const column = (index: number, g: Grid): number => + ((index % g.columns) + g.columns) % g.columns; const inArea = ( index: number,