The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Fix stroke settings

These changes was commited to the Birdfont repository Thu, 30 Jun 2016 10:50:51 +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>
Thu, 30 Jun 2016 10:50:51 +0000 (12:50 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Thu, 30 Jun 2016 10:50:51 +0000 (12:50 +0200)
commit 13bfc25d39a7537c7c2f8dd5d95cac25c09b211b
tree 2777db54788bd86bac45efd00e5cc9c3d541e606
parent 3124d9c71848c473af41df2bbe70a764f614aaef
Fix stroke settings

libbirdfont/DrawingTools.vala
--- a/libbirdfont/DrawingTools.vala +++ b/libbirdfont/DrawingTools.vala @@ -835,12 +835,18 @@ if (StrokeTool.add_stroke) { foreach (SvgBird.Object p in g.active_paths) { - p.style.stroke_width = StrokeTool.stroke_width; - p.style.line_cap = StrokeTool.line_cap; + if (p is PathObject) { + Path path = ((PathObject) p).get_path (); + path.stroke = StrokeTool.stroke_width; + path.line_cap = StrokeTool.line_cap; + } } } else { foreach (SvgBird.Object p in g.active_paths) { - p.style.stroke_width = 0; + if (p is PathObject) { + Path path = ((PathObject) p).get_path (); + path.stroke = 0; + } } } @@ -875,10 +881,9 @@ if (tool && StrokeTool.add_stroke) { foreach (SvgBird.Object p in g.active_paths) { - p.style.stroke_width = StrokeTool.stroke_width; - if (p is PathObject) { Path path = ((PathObject) p).get_path (); + path.stroke = StrokeTool.stroke_width; path.reset_stroke (); } } @@ -944,10 +949,10 @@ g.store_undo_state (); foreach (SvgBird.Object p in g.active_paths) { - p.style.line_cap = SvgBird.LineCap.ROUND; - if (p is PathObject) { - ((PathObject) p).get_path ().reset_stroke (); + Path path = ((PathObject) p).get_path (); + path.line_cap = SvgBird.LineCap.ROUND; + path.reset_stroke (); } } @@ -962,6 +967,7 @@ GlyphCanvas.redraw (); }); + stroke_expander.add_tool (line_cap_round); line_cap_square = new Tool ("line_cap_square", t_("Square line cap")); @@ -972,10 +978,10 @@ g.store_undo_state (); foreach (SvgBird.Object p in g.active_paths) { - p.style.line_cap = SvgBird.LineCap.SQUARE; - if (p is PathObject) { - ((PathObject) p).get_path ().reset_stroke (); + Path path = ((PathObject) p).get_path (); + path.line_cap = SvgBird.LineCap.SQUARE; + path.reset_stroke (); } }