yarn prettier:format
This commit is contained in:
parent
c5eb9f0b99
commit
178c6496bd
1 changed files with 12 additions and 20 deletions
|
@ -316,11 +316,7 @@ function getFreedomLayoutTilePositions(
|
||||||
columnCount: focusedColumnCount,
|
columnCount: focusedColumnCount,
|
||||||
rowCount: focusedRowCount,
|
rowCount: focusedRowCount,
|
||||||
tileAspectRatio: focusedTileAspectRatio,
|
tileAspectRatio: focusedTileAspectRatio,
|
||||||
} = getSubGridLayout(
|
} = getSubGridLayout(focusedTileCount, focusedGridWidth, focusedGridHeight);
|
||||||
focusedTileCount,
|
|
||||||
focusedGridWidth,
|
|
||||||
focusedGridHeight
|
|
||||||
);
|
|
||||||
|
|
||||||
const focusedGridPositions = getSubGridPositions(
|
const focusedGridPositions = getSubGridPositions(
|
||||||
focusedTileCount,
|
focusedTileCount,
|
||||||
|
@ -333,13 +329,7 @@ function getFreedomLayoutTilePositions(
|
||||||
|
|
||||||
const tilePositions = [...focusedGridPositions, ...itemGridPositions];
|
const tilePositions = [...focusedGridPositions, ...itemGridPositions];
|
||||||
|
|
||||||
centerTiles(
|
centerTiles(focusedGridPositions, focusedGridWidth, focusedGridHeight, 0, 0);
|
||||||
focusedGridPositions,
|
|
||||||
focusedGridWidth,
|
|
||||||
focusedGridHeight,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
if (layoutDirection === "vertical") {
|
if (layoutDirection === "vertical") {
|
||||||
centerTiles(
|
centerTiles(
|
||||||
|
@ -664,7 +654,11 @@ function getSubGridPositions(
|
||||||
// Sets the 'order' property on tiles based on the layout param and
|
// Sets the 'order' property on tiles based on the layout param and
|
||||||
// other properties of the tiles, eg. 'focused' and 'presenter'
|
// other properties of the tiles, eg. 'focused' and 'presenter'
|
||||||
function reorderTiles(tiles: Tile[], layout: Layout) {
|
function reorderTiles(tiles: Tile[], layout: Layout) {
|
||||||
if (layout === "freedom" && tiles.length === 2 && !tiles.some(t => t.presenter)) {
|
if (
|
||||||
|
layout === "freedom" &&
|
||||||
|
tiles.length === 2 &&
|
||||||
|
!tiles.some((t) => t.presenter)
|
||||||
|
) {
|
||||||
// 1:1 layout
|
// 1:1 layout
|
||||||
tiles.forEach((tile) => (tile.order = tile.item.isLocal ? 0 : 1));
|
tiles.forEach((tile) => (tile.order = tile.item.isLocal ? 0 : 1));
|
||||||
} else {
|
} else {
|
||||||
|
@ -678,9 +672,7 @@ function reorderTiles(tiles: Tile[], layout: Layout) {
|
||||||
(tile.focused ? focusedTiles : otherTiles).push(tile)
|
(tile.focused ? focusedTiles : otherTiles).push(tile)
|
||||||
);
|
);
|
||||||
|
|
||||||
[...focusedTiles, ...otherTiles].forEach(
|
[...focusedTiles, ...otherTiles].forEach((tile, i) => (tile.order = i));
|
||||||
(tile, i) => (tile.order = i)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -824,7 +816,7 @@ export function VideoGrid({
|
||||||
tilePositions: getTilePositions(
|
tilePositions: getTilePositions(
|
||||||
newTiles.length,
|
newTiles.length,
|
||||||
focusedTileCount,
|
focusedTileCount,
|
||||||
newTiles.some(t => t.presenter),
|
newTiles.some((t) => t.presenter),
|
||||||
gridBounds.width,
|
gridBounds.width,
|
||||||
gridBounds.height,
|
gridBounds.height,
|
||||||
pipXRatio,
|
pipXRatio,
|
||||||
|
@ -849,7 +841,7 @@ export function VideoGrid({
|
||||||
tilePositions: getTilePositions(
|
tilePositions: getTilePositions(
|
||||||
newTiles.length,
|
newTiles.length,
|
||||||
focusedTileCount,
|
focusedTileCount,
|
||||||
newTiles.some(t => t.presenter),
|
newTiles.some((t) => t.presenter),
|
||||||
gridBounds.width,
|
gridBounds.width,
|
||||||
gridBounds.height,
|
gridBounds.height,
|
||||||
pipXRatio,
|
pipXRatio,
|
||||||
|
@ -975,7 +967,7 @@ export function VideoGrid({
|
||||||
tilePositions: getTilePositions(
|
tilePositions: getTilePositions(
|
||||||
newTiles.length,
|
newTiles.length,
|
||||||
focusedTileCount,
|
focusedTileCount,
|
||||||
newTiles.some(t => t.presenter),
|
newTiles.some((t) => t.presenter),
|
||||||
gridBounds.width,
|
gridBounds.width,
|
||||||
gridBounds.height,
|
gridBounds.height,
|
||||||
pipXRatio,
|
pipXRatio,
|
||||||
|
@ -1007,7 +999,7 @@ export function VideoGrid({
|
||||||
|
|
||||||
let newTiles = tiles;
|
let newTiles = tiles;
|
||||||
|
|
||||||
if (tiles.length === 2 && !tiles.some(t => t.presenter)) {
|
if (tiles.length === 2 && !tiles.some((t) => t.presenter)) {
|
||||||
// We're in 1:1 mode, so only the local tile should be draggable
|
// We're in 1:1 mode, so only the local tile should be draggable
|
||||||
if (!dragTile.item.isLocal) return;
|
if (!dragTile.item.isLocal) return;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue