|
|
Donner 0.8.0-pre
Embeddable browser-grade SVG2 engine
|
Static Public Member Functions | |
| static void | drawChrome (svg::RendererInterface &renderer, const EditorApp &editor) |
| Draw all editor chrome layers for the current state of editor into renderer's active frame. No-op if there is no document or no selection. Pulls the canvasFromDocument transform from the editor's document so chrome lands on the same pixels as the rendered content, regardless of canvas/viewBox aspect mismatch. | |
| static void | drawChrome (svg::RendererInterface &renderer, const std::optional< svg::SVGElement > &selection) |
| Overload that takes a selection snapshot directly. Single-element back-compat shim — kept so worker-thread callers and existing tests don't have to switch to spans. Identity canvasFromDoc. | |
| static void | drawChromeWithTransform (svg::RendererInterface &renderer, const std::optional< svg::SVGElement > &selection, const Transform2d &canvasFromDoc) |
| Lower-level single-element entry: draw chrome for selection (or none) using canvasFromDoc. Kept for back-compat with the existing single-select call sites. | |
| static void | drawChromeWithTransform (svg::RendererInterface &renderer, std::span< const svg::SVGElement > selection, const std::optional< Box2d > &marqueeRectDoc, const Transform2d &canvasFromDoc, const std::optional< SelectionChromeBoundsPreview > &activeBoundsPreview=std::nullopt, std::span< const svg::SVGElement > sourceHover={}, const std::optional< Box2d > &cullRectDoc=std::nullopt, SelectionChromeDetail selectionDetail=SelectionChromeDetail::Full, const Transform2d &representedDocumentFromLiveDocument=Transform2d()) |
| Multi-element entry: draw path outlines for every selected element, selection AABBs, and the optional marquee rect into renderer's active frame using canvasFromDoc. | |
| static void | drawChromeWithTransform (svg::RendererInterface &renderer, std::span< const svg::SVGElement > selection, const Transform2d &canvasFromDoc) |
| Back-compat overload without marquee. Kept for existing callers that don't need a marquee rect (older tests, worker-thread helpers). Path outlines + selection AABBs are still drawn. | |
| static SelectionChromeSnapshot | captureChromeSnapshot (std::span< const svg::SVGElement > selection, const std::optional< Box2d > &marqueeRectDoc, const Transform2d &canvasFromDoc, const std::optional< SelectionChromeBoundsPreview > &activeBoundsPreview=std::nullopt, std::span< const svg::SVGElement > sourceHover={}, const std::optional< Box2d > &cullRectDoc=std::nullopt, SelectionChromeDetail selectionDetail=SelectionChromeDetail::Full, const Transform2d &representedDocumentFromLiveDocument=Transform2d()) |
| Build a SelectionChromeSnapshot for the given selection + marquee + canvas transform. Reads computedSpline, elementFromWorld, and SnapshotSelectionWorldBounds for every selected element — MUST be called when the worker is idle or otherwise not mutating these components on the same registry. When cullRectDoc is present, path outlines, AABBs, and handles fully outside that document-space rect are skipped before draw. CombinedBoundsOnly skips selected path extraction and stores one combined bounds box for low-latency large-selection feedback. | |
| static void | drawChromeFromSnapshot (svg::RendererInterface &renderer, const SelectionChromeSnapshot &snapshot) |
| Race-free chrome rasterize: reads only the snapshot, never the registry. Safe to call while the async-renderer worker is mid-render. | |
|
staticnodiscard |
Build a SelectionChromeSnapshot for the given selection + marquee + canvas transform. Reads computedSpline, elementFromWorld, and SnapshotSelectionWorldBounds for every selected element — MUST be called when the worker is idle or otherwise not mutating these components on the same registry. When cullRectDoc is present, path outlines, AABBs, and handles fully outside that document-space rect are skipped before draw. CombinedBoundsOnly skips selected path extraction and stores one combined bounds box for low-latency large-selection feedback.
Design doc 0033 §M7. Returned snapshot is movable and self- contained: it holds no registry pointers and survives any subsequent registry mutation.
|
static |
Race-free chrome rasterize: reads only the snapshot, never the registry. Safe to call while the async-renderer worker is mid-render.
Produces byte-identical pixels to drawChromeWithTransform(selection, marqueeRectDoc, canvasFromDoc) given the same input snapshot — pinned by OverlayRendererTest.SnapshotProducesByteIdenticalPixels.
|
static |
Multi-element entry: draw path outlines for every selected element, selection AABBs, and the optional marquee rect into renderer's active frame using canvasFromDoc.
This renderer-backed path is kept for pixel tests and non-editor callers. The live editor presentation path captures the same snapshot, then draws it immediately through RenderPanePresenter to avoid allocating and uploading a full overlay texture.
AABBs are computed inline from selection (via SnapshotSelectionWorldBounds) at overlay-draw time so they always match the current DOM snapshot — same source of truth as the per-element path outlines. This avoids the frame-lag-shear that happened when AABBs came from a separately-promoted cache while the path outlines came from the live DOM.
| selection | Selected elements whose per-element path outlines
|
| marqueeRectDoc | Optional marquee rect in document space; drawn as a filled + stroked rectangle matching the prior ImGui chrome style. |
| canvasFromDoc | Maps document coordinates into canvas pixels. |
| cullRectDoc | Optional document-space cull rect. Chrome fully outside this rect is skipped before draw. |
| selectionDetail | Detail level for selected-element chrome. |