|
|
Donner
C++20 SVG rendering library
|
Holds global state of an SVG document, such as the root element, id-to-element mapping, and the document size. More...
#include "donner/svg/components/SVGDocumentContext.h"
Public Member Functions | |
| SVGDocumentContext (InternalCtorTag ctorTag, const std::shared_ptr< Registry > ®istry) | |
| Internal constructor, creates a context on the given SVGDocument. | |
| Entity | getEntityById (const RcString &id) const |
| Get the entity with the given ID, using the internal id-to-entity mapping. | |
Public Attributes | |
| std::optional< Vector2i > | canvasSize |
| Current canvas size, if set. Equivalent to the window size, which controls how the SVG contents are rendered. | |
| Entity | rootEntity = entt::null |
| Root entity of the document, which contains the "<svg>" element. | |
Friends | |
| class | ::donner::svg::SVGDocument |
| class | ::donner::svg::SVGElement |
Holds global state of an SVG document, such as the root element, id-to-element mapping, and the document size.
One instance of this class is created per SVG document.
Access the document context via the Registry::ctx API:
|
explicit |
Internal constructor, creates a context on the given SVGDocument.
To use this class, access it via the Registry::ctx API.
| ctorTag | Internal tag to allow construction. |
| registry | Underlying registry for the document. |
|
inline |
Get the entity with the given ID, using the internal id-to-entity mapping.
If multiple elements have the same id, the first one that was created will be returned.
| id | ID to find the entity for. |