The Birdfont Source Code


All Repositories / birdfont.git / blobdiff – RSS feed

Rotation

Changes made to libsvgbird/SvgFile.vala

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
--- libsvgbird/SvgFile.vala +++ libsvgbird/SvgFile.vala @@ -680,6 +680,9 @@ transform_functions.add (matrix (functions[i])); } + if (functions[i].has_prefix ("rotate")) { + transform_functions.add (rotate (functions[i])); + } // TODO: rotate etc. } @@ -737,6 +740,19 @@ } return n; + } + + private static SvgTransform rotate (string function) { + string parameters = get_transform_parameters (function); + string[] p = parameters.split (" "); + SvgTransform transform = new SvgTransform (); + transform.type = TransformType.ROTATE; + + if (p.length > 0) { + transform.arguments.add (parse_double (p[0])); + } + + return transform; } private static SvgTransform scale (string function) {