Панорама двигает сцену трансформом, viewBox пишется по бюджету

Перезапись `viewBox` — это не сдвиг, а инвалидация растеризации всей сцены.
Кадр жеста делал её каждый раз: в профиле владельца (Firefox 155, 144 Гц) кадр
доезжал до экрана 200 мс, а драйвер пропускал 124–144 тика в секунду с пометкой
«ждём краску».

Теперь `paintLiveViewport` держит якорь — кадр, чей `viewBox` записан в DOM, и
момент записи. Кадр жеста двигает узлы сцены тем же проективным преобразованием,
которым уже двигались HTML-слои, а `viewBox` переписывается по бюджету: 100 мс
либо 15 % сдвига/масштаба. Ни атрибут, ни стиль не пишутся, если строка не
изменилась.

Issue: #531
User-Visible: yes
This commit is contained in:
Codex
2026-09-11 14:23:48 +03:00
parent 9d35ab35ac
commit 58e31668c9
43 changed files with 11156 additions and 20 deletions
+30
View File
@@ -1914,6 +1914,36 @@ core; known-LQI and solid parent routes remain single strokes. Cache data, IEEE
addresses and raw payloads are never persisted, logged, exported or admitted
to support diagnostics.
## Live viewport: a transform per frame, a `viewBox` on a budget (#531, 2026-09-11)
Rewriting the `viewBox` attribute is not a move, it is a repaint: the whole SVG
scene is re-rasterized. Doing it once per gesture frame is what made panning
crawl on the owner's machine — the frame reached the screen in 200 ms and the
refresh driver skipped 124–144 ticks per second marked "waiting for paint".
So `paintLiveViewport` keeps an anchor: the frame whose `viewBox` is currently
written into the DOM, and when it was written. Every gesture frame moves the
scene nodes by the same projective transform (`liveLayerProjection`,
`transform-origin: 0 0`) that already moved the HTML layers — a composited move,
no repaint. The `viewBox` is rewritten only when `needsViewBoxRefresh` says so:
`LIVE_VIEWBOX_REFRESH_MS` (100 ms) has passed, or the view shifted by
`LIVE_VIEWBOX_REFRESH_SHIFT` (15 %) of its own size on either axis, or the scale
changed by as much. The time budget covers ordinary dragging; the shift budget
covers a flick, where the plan can travel half a screen before 100 ms is up and
an empty band on the leading edge would become visible. Both are module
constants, not settings.
The two projections have different bases and must stay that way: scene nodes are
projected from the anchor (what is drawn now), HTML layers from the last settled
Lit frame (their content is positioned in percentages of that view). They land on
the same current view, which is what keeps the #451 contract — a marker within
one CSS pixel of its place in the scene — true on every frame of the gesture.
Neither the attribute nor the style is written when the string is unchanged: an
idle frame must leave the DOM byte-identical, or the settled raster shifts by a
few colour levels and golden frames flap. `commitHouseplanViewport` still ends
the gesture the same way — transforms removed, final `viewBox` forced in.
## The initial bundle carries English and Russian whole (#400, 2026-08-31)
`en` and `ru` are synchronous dictionaries in the initial chunk; `de` and `fr`
+7
View File
@@ -8,6 +8,13 @@
are no longer printed
([#530](https://github.com/Matysh/houseplan-card/issues/530)).
- Dragging the plan around is smooth again. Every frame of the gesture used to
redraw the entire plan from scratch instead of simply moving what was already
drawn, which on a high-refresh screen in Firefox turned panning into a slide
show. The plan now slides with the cursor and refreshes its content a few
times a second; the picture you end up with is exactly the same
([#531](https://github.com/Matysh/houseplan-card/issues/531)).
## v1.74.0-beta.2 — 2026-09-11
- A plan left over from the era of “rooms without walls” can be edited again.
+7
View File
@@ -14,6 +14,13 @@
внутри комнаты, больше не печатаются
([#530](https://github.com/Matysh/houseplan-card/issues/530)).
- Перетаскивание плана снова плавное. Каждый кадр жеста заново рисовал весь
план целиком вместо того, чтобы сдвинуть уже нарисованное, — на экране с
высокой частотой в Firefox панорама превращалась в слайд-шоу. Теперь план
едет за курсором, а содержимое подтягивается несколько раз в секунду; итоговая
картинка ровно та же
([#531](https://github.com/Matysh/houseplan-card/issues/531)).
## v1.74.0-beta.2 — 2026-09-11
- План, доставшийся от времён «комнат без стен», снова редактируется. Такой план