|
|
Donner 0.5.1
Embeddable browser-grade SVG2 engine
|
ViewportState is the single source of truth for the editor render pane's screen↔document coordinate mapping. See docs/design_docs/0025-editor_ux.md for the full design rationale; this header is the public API. More...
Classes | |
| struct | donner::editor::ViewportState |
| All viewport state for a single frame of the render pane. Plain data, side-effect-free, copyable, ~80 bytes. More... | |
Namespaces | |
| namespace | donner |
| Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css. | |
ViewportState is the single source of truth for the editor render pane's screen↔document coordinate mapping. See docs/design_docs/0025-editor_ux.md for the full design rationale; this header is the public API.
Conceptually a ViewportState is a value the main loop snapshots once at the top of each frame and then hands to every reader (async render dispatch, click math, overlay re-render, image draw, inspector text). Every reader consults the same value, so the four pieces never disagree about where the document is on screen.
Coordinate spaces:
Zoom semantics: zoom == 1.0 means 100% — one SVG viewBox unit takes exactly one screen pixel. This is the initial state when the editor opens and the target of Cmd+0 / View → Reset Zoom. The user can pan freely if the document doesn't fit the window.