Fix zero participant tiles case

This commit is contained in:
Robert Long 2021-08-31 15:39:31 -07:00
parent c8192ac48c
commit 09d726a5a8

View file

@ -69,8 +69,10 @@ function getTilePositions(
participantGridHeight = gridHeight; participantGridHeight = gridHeight;
} }
const participantTileCount = tileCount - presenterTileCount;
const participantGridPositions = getSubGridPositions( const participantGridPositions = getSubGridPositions(
tileCount - presenterTileCount, participantTileCount,
participantGridWidth, participantGridWidth,
participantGridHeight, participantGridHeight,
gap gap
@ -84,9 +86,13 @@ function getTilePositions(
presenterGridHeight = 0; presenterGridHeight = 0;
} else if (layoutDirection === "vertical") { } else if (layoutDirection === "vertical") {
presenterGridWidth = gridWidth; presenterGridWidth = gridWidth;
presenterGridHeight = gridHeight - (participantGridBounds.height + gap * 2); presenterGridHeight =
gridHeight -
(participantGridBounds.height + (participantTileCount ? gap * 2 : 0));
} else { } else {
presenterGridWidth = gridWidth - (participantGridBounds.width + gap * 2); presenterGridWidth =
gridWidth -
(participantGridBounds.width + (participantTileCount ? gap * 2 : 0));
presenterGridHeight = gridHeight; presenterGridHeight = gridHeight;
} }