The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Fix SVG bounding box

These changes was commited to the Birdfont repository Fri, 22 Jul 2016 17:01:24 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Fri, 22 Jul 2016 17:01:24 +0000 (19:01 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Fri, 22 Jul 2016 17:01:24 +0000 (19:01 +0200)
commit f303c578bf1ab232a57226710f852bb27f46ea20
tree 302683429f067686615738c1399c482599c1750c
parent ae45a1ed94708e814c8377b10c2775589cbf8cbb
Fix SVG bounding box

libsvgbird/Object.vala
libsvgbird/SvgTransform.vala
--- a/libsvgbird/Object.vala +++ b/libsvgbird/Object.vala @@ -310,16 +310,15 @@ draw_outline (context); context.save (); - + context.set_matrix (Matrix.identity ()); + if (has_stroke) { context.stroke_extents (out x0, out y0, out x1, out y1); } else { context.fill_extents (out x0, out y0, out x1, out y1); } - - Matrix matrix = context.get_matrix (); - matrix.transform_point (ref x0, ref y0); - matrix.transform_point (ref x1, ref y1); + + context.set_matrix (view_matrix); context.fill (); context.restore ();
--- a/libsvgbird/SvgTransform.vala +++ b/libsvgbird/SvgTransform.vala @@ -73,13 +73,11 @@ double r = arguments.get_double (0); r *= Math.PI / 180; matrix.rotate (r); - return matrix; } } else if (type == TransformType.SCALE) { if (arguments.size == 1) { double s = arguments.get_double (0); matrix.scale (s, s); - return matrix; } else if (arguments.size == 2) { double s0 = arguments.get_double (0); double s1 = arguments.get_double (1);