The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Fill open stroke

These changes was commited to the Birdfont repository Thu, 30 Apr 2015 19:01:43 +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 Apr 2015 19:01:43 +0000 (21:01 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Thu, 30 Apr 2015 19:02:28 +0000 (21:02 +0200)
commit fc04168476af6586ef18a8e3fa5229ec71da59c7
tree 732640aec3c4f5f0a87ca37d8f9d3b4e264b6666
parent 85ccd2f37acfee9d67284e44da8a39db13cd3ff0
Fill open stroke

libbirdfont/Glyph.vala
libbirdfont/Path.vala
libbirdfont/PenTool.vala
libbirdfont/StrokeTool.vala
--- a/libbirdfont/Glyph.vala +++ b/libbirdfont/Glyph.vala @@ -1530,12 +1530,17 @@ foreach (Path p in path_list) { if (p.stroke > 0) { stroke = p.get_stroke_fast (); - - if (p.is_editable () || active_paths.index_of (p) > -1) { - draw_path_list (stroke, cr); + + if (p.is_editable ()) { + color = Theme.get_color ("Filled Stroke"); + color.a = 0.8; + } else if (active_paths.index_of (p) > -1) { + color = Theme.get_color ("Selected Objects"); } else { - draw_path_list (stroke, cr, Theme.get_color ("Filled Stroke")); + color = Color.black (); } + + draw_path_list (stroke, cr, color); } } cr.fill ();
--- a/libbirdfont/Path.vala +++ b/libbirdfont/Path.vala @@ -563,8 +563,8 @@ cr.save (); - x = xc + x - (width / 2.0) * ivz; - y = yc - y - (width / 2.0) * ivz; + x = xc + x; + y = yc - y; cr.set_source_rgba (color.r, color.g, color.b, color.a);
--- a/libbirdfont/PenTool.vala +++ b/libbirdfont/PenTool.vala @@ -552,8 +552,13 @@ public static void reset_stroke () { Glyph g = MainWindow.get_current_glyph (); + foreach (PointSelection p in selected_points) { p.path.reset_stroke (); + } + + foreach (Path path in g.active_paths) { + path.reset_stroke (); } }
--- a/libbirdfont/StrokeTool.vala +++ b/libbirdfont/StrokeTool.vala @@ -1713,7 +1713,7 @@ p2 = path.points.get ((i + 1) % path.points.size); p3 = path.points.get ((i + 2) % path.points.size); - tolerance = 1.3 / sqrt (stroke_width); + tolerance = 0.13 / sqrt (stroke_width); step_increment = 1.1; step_size = 0.039 / stroke_width;