mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Move Visual to the left rail and let panels sit at the screen edge
The left rail holds Data Layers, Utilities, Authoring and Visual; the right rail holds Context, CCTV and Street Level. A button in each panel header moves that side's panels to the screen edge, with the rail as a row above them, and scrolling at a screen edge steps through a rail's panels. An open right panel starts just under the HUD readouts, and Context and CCTV take the column's full height. The right rail stays level with the left column's top whichever left panel is open, in both layouts. Co-authored-by: Sameh Khamis <[email protected]>
This commit is contained in:
1 parent
f0a8b1193a
commit
7ee047961b
16 files changed
+999
-12
No files matched your search
@@ -6,9 +6,20 @@
|
||||
* @returns {number} Natural height in CSS pixels.
|
||||
*/
|
||||
export function measurePanelNaturalHeight(panel, getComputedStyle) {
|
||||
const inner = [...panel.children].find(
|
||||
const content = [...panel.children].filter(
|
||||
(child) => !child.classList.contains('panel-glow'),
|
||||
);
|
||||
// A panel built as a header row and a body (Visual) scrolls as a whole, so
|
||||
// its full scroll height is its natural height.
|
||||
if (content.length > 1) {
|
||||
const panelStyle = getComputedStyle(panel);
|
||||
return Math.ceil(
|
||||
panel.scrollHeight +
|
||||
(parseFloat(panelStyle.borderTopWidth) || 0) +
|
||||
(parseFloat(panelStyle.borderBottomWidth) || 0),
|
||||
);
|
||||
}
|
||||
const inner = content[0];
|
||||
if (!inner)
|
||||
return Math.ceil(
|
||||
panel.scrollHeight || panel.getBoundingClientRect().height,
|
||||
|
||||
Reference in new issue
Block a user