|
|
Donner
C++20 SVG rendering library
|
Parse an SVG transform attribute, such as translate(100 100), using the SVG syntax which does not support units on numbers. More...
#include "donner/svg/parser/TransformParser.h"
Static Public Member Functions | |
| static ParseResult< Transformd > | Parse (std::string_view str) |
| Parse an SVG transform="..." attribute. | |
Parse an SVG transform attribute, such as translate(100 100), using the SVG syntax which does not support units on numbers.
|
static |
Parse an SVG transform="..." attribute.
Compared to the CSS transform attribute, CssTransformParser, this parser does not support units on numbers, and the default units are pixels and degrees.
Supported functions:
| Function | Description |
|---|---|
| matrix(a, b, c, d, e, f) | Matrix transform.
|
| translate(x, y=0) | Translates by (x, y) pixels. |
| scale(x, y=x) | Scales by (x, y). |
| rotate(angle) | Rotates by angle degrees. |
| rotate(angle, cx, cy) | Rotates by angle degrees around (cx, cy). |
| skewX(angle) | Skews by angle degrees along the X axis. |
| skewY(angle) | Skews by angle degrees along the Y axis. |
Commas between parameters are optional, and multiple transform functions may be composed for more complex transforms, such as rotate(45) translate(100 100).
| str | String corresponding to the SVG transform attribute. |