Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::editor::OverlayRenderer Class Reference

Static Public Member Functions

static void drawChrome (svg::Renderer &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::Renderer &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::Renderer &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::Renderer &renderer, std::span< const svg::SVGElement > selection, const std::optional< Box2d > &marqueeRectDoc, const Transform2d &canvasFromDoc)
 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::Renderer &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.

Member Function Documentation

◆ drawChromeWithTransform()

void donner::editor::OverlayRenderer::drawChromeWithTransform ( svg::Renderer & renderer,
std::span< const svg::SVGElement > selection,
const std::optional< Box2d > & marqueeRectDoc,
const Transform2d & canvasFromDoc )
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.

All chrome lives in this one rasterized overlay layer. The earlier "two-path" design that drew AABBs + marquee directly via ImGui's draw list in RenderPanePresenter was folded into here — Geode can optimize the whole layer end-to-end (a single invalidation envelope, a single GPU upload) once it lands.

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.

Parameters
selectionSelected elements whose per-element path outlines
  • AABBs should be drawn.
marqueeRectDocOptional marquee rect in document space; drawn as a filled + stroked rectangle matching the prior ImGui chrome style.
canvasFromDocMaps document coordinates into canvas pixels.

The documentation for this class was generated from the following file: