Clone in a terminal:
Commit 0417863
Johan Mattsson - 2015-11-01T16:28:36+00:00
0417863cf3c7b9702d3730895edf08a72201ddc3johan.mattsson.m@gmail.com

Fix zero length handles

Changed files (1)

Diff

diff --git a/libbirdfont/BezierTool.vala b/libbirdfont/BezierTool.valaindex 9105ad7..8dfbc4b 100644--- a/libbirdfont/BezierTool.vala+++ b/libbirdfont/BezierTool.vala@@ -244,7 +244,6 @@ public class BezierTool : Tool { 	public void release (int b, int x, int y) { 		double px, py; 		Glyph g;-		EditPoint first, last; 		 		if (!button_down) { 			warning ("Discarding event.");@@ -296,23 +295,29 @@ public class BezierTool : Tool { 			} else { 				current_path.force_direction (Direction.CLOCKWISE); 			}-			-			first = current_path.get_first_point ();-			if (first.get_right_handle ().length == 0) {-				first.convert_to_line ();-			}--			last = current_path.get_last_point ();-			if (last.get_left_handle ().length == 0) {-				last.convert_to_line ();-			} 						 			current_path.reset_stroke (); 			 			state = NONE; 		}+        +        convert_zero_length_handles_to_lines (); 	} 	+    void convert_zero_length_handles_to_lines () {+        EditPoint first, last;+        +        first = current_path.get_first_point ();+        if (first.get_right_handle ().length == 0) {+            first.convert_to_line ();+        }++        last = current_path.get_last_point ();+        if (last.get_left_handle ().length == 0) {+            last.convert_to_line ();+        }+    }+             	public void move (int x, int y) { 		double px, py; 		

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112