Re-fit the viewport whenever the canvas box moves

The portrait fit was right, it just ran once and too early: iOS Safari lays the
page out before its toolbars settle, so the box the first fit measured was short
by a strip — and no window resize follows, because the page never scrolls. The
height only came good after a rotate and back, which IS a resize. A
ResizeObserver on the canvas watches the box itself, so every cause is covered
(bars settling, rotation, split view, zoom) without guessing which event or delay
to listen for. It only rewrites the backing store, never the CSS box, so it
cannot feed itself.

Verified both directions: box grows -> logical H 585 -> 671, box back -> 585,
logical aspect matching the box aspect each time.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
wuwiandClaude Opus 5 committed 2026-07-31 08:49:02 +02:00
1 parent 5f97c7cff4
commit e8116c6abb
2 files changed
+10 -2

No files matched your search

+1 -1
View File
@@ -89,6 +89,6 @@
<p id="build"></p>
</div>
</div>
<script type="module" src="main.js?v=51"></script>
<script type="module" src="main.js?v=52"></script>
</body>
</html>