The Birdfont Source Code


All Repositories / birdfont.git / commit – 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
author Johan Mattsson <johan.mattsson.m@gmail.com>
Tue, 12 Jul 2016 13:31:12 +0000 (15:31 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Tue, 12 Jul 2016 13:31:12 +0000 (15:31 +0200)
commit 0231f8f4517777e8db3519def3ee894884b57b9b
tree 938a739c1c60107d8c404a0028a43d5ecea5edbf
parent 11767cb97ef0f9ba3cb8da58712c7dbd22a616a0
Fix gradient matrix

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;