The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – 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
[Thu, 30 Jun 2016 10:50:51 +0000]

Updated Files

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 (); } }