Class GuiSvgDocument
java.lang.Object
com.render.api.gui.GuiSvgDocument
Retained mutable SVG element tree with stable node identities and versioned asynchronous rasterization.
DOM and style mutations increment generation(). The shared asset manager keeps the last valid texture
visible while a newer generation rasterizes. Each mutable document owns a distinct asset identity, even when several
documents are parsed from the same markup.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classStable retained SVG element wrapper. -
Method Summary
Modifier and TypeMethodDescriptionappend(GuiSvgDocument.Node parent, String tag) static GuiSvgDocumentbuilder(GuiSvgBuilder builder) cacheKey()edit(Consumer<GuiSvgDocument> edits) Applies a group of DOM/style edits with one cascade refresh and one publication generation.longfloatfloathitTest(float x, float y) Performs transformed retained hit testing for SVG viewport, shape, path, line, polyline, polygon, image, and text geometry.Reports painted features whose exact hit geometry is unavailable.com.render.api.gui.GuiLoadedAssetload()markup()nodes()static GuiSvgDocumentcom.render.api.gui.GuiAssetSourcerasterVariant(float physicalWidth, float physicalHeight) voidremove(GuiSvgDocument.Node node) root()rule(GuiSvgSelector selector, Consumer<GuiStyleBuilder> declarations) Adds a retained typed presentation rule and applies all rules in source order.booleansampleAnimations(double animationTimeSeconds) Samples every retained SVG attribute animation against a view animation clock.select(GuiSvgSelector selector) com.render.api.gui.GuiAssetSource.LoadSnapshot
-
Method Details
-
parse
-
builder
-
root
-
nodes
-
byId
-
select
-
edit
Applies a group of DOM/style edits with one cascade refresh and one publication generation. Nested edits share the outer transaction. An exception still publishes mutations already performed.- Parameters:
edits- mutations of this retained document- Returns:
- this document
-
rule
Adds a retained typed presentation rule and applies all rules in source order.- Returns:
- this document
-
append
-
remove
-
hitTest
Performs transformed retained hit testing for SVG viewport, shape, path, line, polyline, polygon, image, and text geometry. Visibility and pointer-event suppression are honored; nodes later in paint order win. -
hitTestLimitations
Reports painted features whose exact hit geometry is unavailable. Masked/filtered/CSS-painted nodes are conservatively excluded from hit testing rather than returned using an unrelated bounding box.- Returns:
- deduplicated unsupported hit features present in the document
-
markup
-
sampleAnimations
public boolean sampleAnimations(double animationTimeSeconds) Samples every retained SVG attribute animation against a view animation clock.The document generation changes only if at least one serialized attribute value changes. RenderLib invokes this automatically when the document is painted; it is public so a caller can drive a detached document with another retained clock.
- Parameters:
animationTimeSeconds- clock time in seconds- Returns:
- whether the sampled SVG markup changed
-
cacheKey
-
generation
public long generation() -
hintWidth
public float hintWidth() -
hintHeight
public float hintHeight() -
load
-
snapshotForLoad
public com.render.api.gui.GuiAssetSource.LoadSnapshot snapshotForLoad() -
rasterVariant
public com.render.api.gui.GuiAssetSource rasterVariant(float physicalWidth, float physicalHeight)
-