Make the scoreboard scale with the real viewport, not assumed 1920x1080 #3
Loading…
Reference in a new issue
No description provided.
Delete branch "tv-viewport-relative-scaling"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Three more bugs reported from the actual TV: Armando, Gus, Teresa and Tino
(the last two rows of each column) were missing entirely, both Miguels were
truncating to "MIGUE...", and there was visible dead space above the title.
Root cause
Every size in the previous CSS was a fixed px value tuned for exactly
1920x1080. Whatever the TV's browser actually renders at internally (device
pixel ratio, a scaled internal resolution, kiosk-app zoom - not something
inspectable remotely) evidently isn't a clean 1920x1080 canvas, so the
design was overflowing 100vh (pushing the last two rows per column below the
fold) and its column-width assumptions no longer held for the two longer
names.
Confirmed with Canvas
measureTextthis was never a space problem at1920x1080 - even "ARMANDO" only ever needed 178px of a ~530px budget. Every
dimension that participates in the fit (padding, gaps, font sizes, the rank
badge) is now vh/vw instead of px, so the same comfortable margin holds
regardless of the real viewport.
Title dead space
The title uses the same Pricedown font as player names, so it had the exact
same low-baseline issue fixed in the previous PR - same measured correction
(
translateY(-0.175em)) applied.Also
Added
overflow: hiddenon the page itself. Chained vh/vw percentages roundto whole px at slightly different points depending on the exact viewport,
and the design's entire premise is that it never scrolls - enforcing that
directly is safer than chasing sub-pixel rounding across browsers.
Testing
Verified at 1920x1080 and 1280x720 with a diagnostic script measuring actual
getBoundingClientRectpositions (not just eyeballing screenshots): bothrender identically to the previously-tested production design, with about
5% of vertical headroom to spare in both cases.