Merge pull request #1053 from robintown/local-tile-size
Cap the size of the local tile in 1:1 calls
This commit is contained in:
commit
e3c34a7145
1 changed files with 10 additions and 2 deletions
|
@ -173,8 +173,16 @@ function getOneOnOneLayoutTilePositions(
|
||||||
const gridAspectRatio = gridWidth / gridHeight;
|
const gridAspectRatio = gridWidth / gridHeight;
|
||||||
|
|
||||||
const smallPip = gridAspectRatio < 1 || gridWidth < 700;
|
const smallPip = gridAspectRatio < 1 || gridWidth < 700;
|
||||||
const pipWidth = smallPip ? 114 : 230;
|
const maxPipWidth = smallPip ? 114 : 230;
|
||||||
const pipHeight = smallPip ? 163 : 155;
|
const maxPipHeight = smallPip ? 163 : 155;
|
||||||
|
// Cap the PiP size at 1/3 the remote tile size, preserving aspect ratio
|
||||||
|
const pipScaleFactor = Math.min(
|
||||||
|
1,
|
||||||
|
remotePosition.width / 3 / maxPipWidth,
|
||||||
|
remotePosition.height / 3 / maxPipHeight
|
||||||
|
);
|
||||||
|
const pipWidth = maxPipWidth * pipScaleFactor;
|
||||||
|
const pipHeight = maxPipHeight * pipScaleFactor;
|
||||||
const pipGap = getPipGap(gridAspectRatio, gridWidth);
|
const pipGap = getPipGap(gridAspectRatio, gridWidth);
|
||||||
|
|
||||||
const pipMinX = remotePosition.x + pipGap;
|
const pipMinX = remotePosition.x + pipGap;
|
||||||
|
|
Loading…
Reference in a new issue