The Birdfont Source Code
Remove parts without are in stroke
These changes was commited to the Birdfont repository Mon, 27 Apr 2015 19:42:45 +0000.
Contributing
Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
Remove parts without are in stroke
--- a/libbirdfont/ForesightTool.vala
+++ b/libbirdfont/ForesightTool.vala
@@ -47,6 +47,7 @@
p.release_action (p, 1, last_move_x, last_move_y);
}
+ MainWindow.set_cursor (NativeWindow.VISIBLE);
state = NONE;
});
@@ -57,6 +58,7 @@
p.release_action (p, 1, last_move_x, last_move_y);
}
+ MainWindow.set_cursor (NativeWindow.VISIBLE);
state = NONE;
});
@@ -211,6 +213,7 @@
if (state == MOVE_HANDLES || state == MOVE_LAST_HANDLE) {
if (previous_point > 0) {
return_if_fail (PenTool.active_path.points.size >= previous_point + 1);
+ return_if_fail (PenTool.active_path.points.size > 0);
last = new PointSelection (PenTool.active_path.points.get (PenTool.active_path.points.size - (previous_point + 1)), PenTool.active_path);
} else {
if (unlikely (PenTool.selected_points.size == 0)) {
--- a/libbirdfont/StrokeTool.vala
+++ b/libbirdfont/StrokeTool.vala
@@ -1032,7 +1032,13 @@
foreach (EditPoint ep in p.points) {
l = ep.get_left_handle ();
r = ep.get_right_handle ();
- if (!(fabs (l.angle - r.angle) < 0.0001 && l.length > 0.01 && r.length > 0.01)) {
+
+ if (l.length < 0.01 || r.length < 0.01) {
+ continue;
+ }
+
+ if (!(fabs ((l.angle - r.angle + PI) % 2 * PI) < 0.0001)
+ && !(fabs (l.angle - r.angle) < 0.0001)) {
return false;
}
}
@@ -1710,7 +1716,7 @@
p2 = path.points.get ((i + 1) % path.points.size);
p3 = path.points.get ((i + 2) % path.points.size);
- tolerance = 1.2 / sqrt (stroke_width);
+ tolerance = 0.13 / sqrt (stroke_width);
step_increment = 1.1;
step_size = 0.039 / stroke_width;