Skip to main content

Module svg

Module svg 

Source
Expand description

Shared animated SVG assets and runtime templates for all presenters.

Functions§

cpp_template
one_size
Whether an Image shows a declared picture at one size: every side it gives is a number, and it does not fly to another (hero). Such a picture is double-sampled where it shows: decoded at twice the physical pixels it covers, which the compositor halves. Squeezed down from a much larger picture by the compositor alone, its edges would break up.
prepare
Target lowering is shared by checking, generation, and packaging. A document engine is heavy: every Svg whose document neither moves nor runs becomes a picture of it, drawn when the app is built (one in the color of the text around it as a template; one with colors per appearance as two, the dark one in the Image’s own dark_source, which each frontend shows where the image is dark), and the others do too where the target has no WebView.
resource_path
static_files
Rasterization runs in the build tool, never in the shipped app. static_source supplies a deliberate final pose for animated artwork.
template
Templates use JSON-compatible quoted strings; Kotlin additionally needs dollar signs escaped to preserve JavaScript template literals.
used
validate