|
|
Donner 0.5.1
Embeddable browser-grade SVG2 engine
|
Provides hit-testing and spatial queries for an SVG document. More...
#include "donner/svg/DonnerController.h"
Public Member Functions | |
| DonnerController (SVGDocument document) | |
| Create a controller for the given document. | |
| std::optional< SVGGeometryElement > | findIntersecting (const Vector2d &point) |
| Finds the topmost geometry element whose rendered area contains the given point. | |
Provides hit-testing and spatial queries for an SVG document.
Use DonnerController when you need to determine which element is at a given point (e.g., for mouse interaction in a viewer). This supplements the DOM traversal API on SVGElement with geometry-aware queries.
|
explicit |
Create a controller for the given document.
| document | The SVG document to query. |
| std::optional< SVGGeometryElement > donner::svg::DonnerController::findIntersecting | ( | const Vector2d & | point | ) |
Finds the topmost geometry element whose rendered area contains the given point.
The point is in SVG canvas coordinates (the same coordinate space as the root <svg> element's viewBox). Returns the deepest matching element in paint order (last painted = topmost).
| point | Position in canvas coordinates. |
std::nullopt if no element is hit.