|
| std::vector< svg::SVGGeometryElement > | donner::editor::CollectRenderableGeometry (const svg::SVGElement &root) |
| | Collect every renderable svg::SVGGeometryElement in root's subtree (including root itself if it is geometry). Skips container subtrees that are not part of the visual tree - defs, clipPath, mask, filter, pattern, gradients, symbol, marker, style.
|
|
std::vector< svg::SVGTextElement > | donner::editor::CollectRenderableTextRoots (const svg::SVGElement &root) |
| | Collect every renderable <text> root in root's subtree (including root itself if it is one). Skips the same non-rendered containers as CollectRenderableGeometry and does not descend into text content - tspans contribute chrome through their text root.
|
|
std::optional< Box2d > | donner::editor::TextWorldInkBounds (const svg::SVGTextElement &text) |
| | Document-space AABB of text's laid-out glyph ink, or nullopt when the text has no ink (empty content or unlaid-out text). The text-local ink box is mapped corner-by-corner through the element's transform, so a rotated text still produces a covering axis-aligned box.
|
|
std::optional< Box2d > | donner::editor::AuthoredTextBoxLocal (const svg::SVGTextElement &text) |
| | Text-local frame rect authored by the text tool: the data-donner-text-box-width/-height region anchored one font-size above the x/y origin (inverting the tool's "first baseline sits one
font-size below the box top" rule). Nullopt for point text.
|
|
std::optional< Box2d > | donner::editor::TextWorldFrameBounds (const svg::SVGTextElement &text) |
| | Document-space frame of text: the authored text box when present (the region the user dragged out), otherwise the laid-out ink bounds (the computed extent of a point-text span). This is the rect that selection chrome and transform handles anchor to.
|
| std::vector< Box2d > | donner::editor::SnapshotSelectionWorldBounds (std::span< const svg::SVGElement > selection) |
| | Snapshot world-space bounds for every selected element that has renderable content. Elements that are themselves geometry contribute their own bounds; <text> roots contribute their laid-out ink bounds; group-like elements contribute the union of their renderable descendants. Elements with no renderable content produce no entry.
|
| std::vector< Box2d > | donner::editor::SnapshotSelectionOccludingWorldBounds (std::span< const svg::SVGElement > selection) |
| | Snapshot world-space bounds for renderable content (geometry and text) painted after a single selected element. This is a conservative occlusion hint for the async-safe re-drag path: if the click falls inside one of these bounds, the editor should wait for the normal hit-test path instead of assuming the selected element owns the click.
|
|
void | donner::editor::PromoteSelectionBoundsIfReady (SelectionBoundsCache &cache, std::uint64_t displayedDocVersion) |
| | Promote pending bounds when the corresponding document bitmap is visible.
|
|
void | donner::editor::RefreshSelectionBoundsCache (SelectionBoundsCache &cache, std::span< const svg::SVGElement > selection, std::uint64_t currentDocVersion, std::uint64_t displayedDocVersion) |
| | Refresh the cache from the current selection and document version.
|
| std::vector< svg::SVGGeometryElement > donner::editor::CollectRenderableGeometry |
( |
const svg::SVGElement & | root | ) |
|
|
nodiscard |
Collect every renderable svg::SVGGeometryElement in root's subtree (including root itself if it is geometry). Skips container subtrees that are not part of the visual tree - defs, clipPath, mask, filter, pattern, gradients, symbol, marker, style.
Used by the editor to expand a group selection ("I picked this
`<g filter>`") into the set of leaves whose outlines + world bounds should drive selection chrome.