Clone in a terminal:
Commit b5ef79b
Johan Mattsson - 2012-10-20T17:33:45+00:00
b5ef79bb76d2d37d40a882e1e417b93101b15bc5johan.mattsson.m@gmail.com

keep direction for paths

Changed files (4)

Diff

diff --git a/src/CutTool.vala b/src/CutTool.valaindex 590a6a1..40aab82 100644--- a/src/CutTool.vala+++ b/src/CutTool.vala@@ -46,8 +46,7 @@ class CutTool : Tool { 		Tool current_tool = MainWindow.get_toolbox ().get_current_tool (); 		 		foreach (Path p in g.active_paths) {-			if (p.is_editable () && p.is_open ()) {-				+			if (p.is_open () && !p.has_direction ()) { 				if (current_tool is PenTool) { 					p.force_direction (Direction.CLOCKWISE); 				} else if (current_tool is CutTool) {diff --git a/src/ExportTool.vala b/src/ExportTool.valaindex 83aa4d7..d3eb1a9 100644--- a/src/ExportTool.vala+++ b/src/ExportTool.vala@@ -447,7 +447,6 @@ os.put_string (   	public class ExportThread : GLib.Object {- 		private string ffi; 		private string ttf; 		private string eot;diff --git a/src/Path.vala b/src/Path.valaindex bfce4da..d926f18 100644--- a/src/Path.vala+++ b/src/Path.vala@@ -40,6 +40,7 @@ public class Path {  	bool edit = true; 	bool open = true;+	bool direction_is_set = false;  	bool no_derived_direction = false; 	bool clockwise_direction = true;@@ -70,6 +71,10 @@ public class Path { 		} 	} +	public bool has_direction () {+		return direction_is_set;+	}+ 	public bool empty () { 		return points.length () == 0; 	}@@ -368,6 +373,7 @@ public class Path { 	 */ 	public bool force_direction (Direction direction) { 		bool c = (direction == Direction.CLOCKWISE);+		direction_is_set = true; 		 		if (c != is_clockwise ()) { 			this.reverse ();@@ -377,7 +383,7 @@ public class Path { 			warning ("Failed to set direction for path in force_direction."); 			return true; 		}-		+				 		return false; 	} diff --git a/src/PenTool.vala b/src/PenTool.valaindex 5adbcee..0b4bd42 100644--- a/src/PenTool.vala+++ b/src/PenTool.vala@@ -258,7 +258,7 @@ class PenTool : Tool { 		 		// continue adding points from the selected one 		foreach (Path p in glyph.active_paths) {-			if (p.points.length () > 0 && active_edit_point == p.points.first ().data) {+			if (p.is_open () && p.points.length () > 0 && active_edit_point == p.points.first ().data) { 				p.reverse (); 			} 		}

Contact

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