mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 10:12:18 +00:00
fix(ui): the left rail's panels use all the room it counted above an obstacle across the middle
Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
98a100ed7e
commit
81df2c8c42
3 files changed
+25
-9
No files matched your search
@@ -115,7 +115,8 @@ export function layoutLeftPanelRail({
|
||||
const baseTop = viewportHeight * 0.26;
|
||||
const baseBottomInset = viewportHeight * 0.04;
|
||||
const safeGap = viewportHeight * 0.012;
|
||||
let obstacleSafeTop = viewportHeight * 0.04;
|
||||
const topInset = viewportHeight * 0.04;
|
||||
let obstacleSafeTop = topInset;
|
||||
let safeTop = baseTop;
|
||||
let safeBottom = viewportHeight - baseBottomInset;
|
||||
const bottomObstacles = [];
|
||||
@@ -159,18 +160,19 @@ export function layoutLeftPanelRail({
|
||||
}
|
||||
}
|
||||
// Obstacles across the midpoint (common in short windows) put the panels
|
||||
// on whichever side of them has more room; with no room on either side the
|
||||
// on whichever side of them has more room, and the panels may use all of
|
||||
// it, above the corridor's usual top too; with no room on either side the
|
||||
// obstacles are read as before.
|
||||
const beside = bandBesideMidpointObstacles({
|
||||
midpoint: viewportHeight * 0.5,
|
||||
top: viewportHeight * 0.04,
|
||||
top: topInset,
|
||||
bottom: safeBottom,
|
||||
obstacles: inLane,
|
||||
gap: safeGap,
|
||||
});
|
||||
if (beside) {
|
||||
obstacleSafeTop = beside.top;
|
||||
safeTop = Math.max(baseTop, beside.top);
|
||||
safeTop = beside.top;
|
||||
bottomObstacles.length = 0;
|
||||
bottomObstacles.push({ top: beside.bottom + safeGap });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user