The Birdfont Source Code
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
Fill open stroke
--- 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;