Commit b5ef79b
keep direction for paths
Changed files (4)
modifiedsrc/CutTool.valamodifiedsrc/ExportTool.valamodifiedsrc/Path.valamodifiedsrc/PenTool.vala
Diff
@@ -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) {@@ -447,7 +447,6 @@ os.put_string ( public class ExportThread : GLib.Object {- private string ffi; private string ttf; private string eot;@@ -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; } @@ -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 (); } }