The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Fix gradient matrix

These changes was commited to the Birdfont repository Tue, 12 Jul 2016 13:31:12 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Tue, 12 Jul 2016 13:31:12 +0000]

Updated Files

libsvgbird/Gradient.vala
libsvgbird/Object.vala
--- a/libsvgbird/Gradient.vala +++ b/libsvgbird/Gradient.vala @@ -23,6 +23,7 @@ public string id = ""; public string? href = null; public SvgTransforms transforms; + public Matrix view_matrix = Matrix.identity (); public Gradient () { stops = new Gee.ArrayList<Stop> ();
--- a/libsvgbird/Object.vala +++ b/libsvgbird/Object.vala @@ -147,7 +147,7 @@ cr.fill_preserve (); } else { cr.fill (); - } + } } if (style.stroke_gradient != null) { @@ -184,7 +184,13 @@ Matrix gradient_matrix = g.get_matrix (); gradient_matrix.invert (); + Matrix object_matrix = transforms.get_matrix (); + object_matrix.invert (); + gradient_matrix.multiply (gradient_matrix, object_matrix); + pattern.set_matrix (gradient_matrix); + + g.view_matrix = gradient_matrix; foreach (Stop s in g.stops) { Color c = s.color;