Commit 4b2c5c4
linear handles for next point
Changed files (3)
Diff
@@ -107,6 +107,10 @@ class EditPoint { return_if_fail (type == PointType.LINE); + if (prev == null && next != null) {+ prev = get_next ().last ();+ }+ // left handle if (prev != null) { n = get_prev ().data;@@ -116,6 +120,16 @@ class EditPoint { ny = y + ((n.y - y) / 3); h.move_to_coordinate (nx, ny); + + // on the other side+ h = n.get_right_handle ();+ + if (h.type == PointType.LINE) {+ nx = n.x + ((x - n.x) / 3);+ ny = n.y + ((y - n.y) / 3);+ + h.move_to_coordinate (nx, ny);+ } } // right handle@@ -127,6 +141,16 @@ class EditPoint { ny = y + ((n.y - y) / 3); h.move_to_coordinate (nx, ny);+ + // on the other side+ h = n.get_left_handle ();+ + if (h.type == PointType.LINE) {+ nx = n.x + ((x - n.x) / 3);+ ny = n.y + ((y - n.y) / 3);+ + h.move_to_coordinate (nx, ny);+ } } } @@ -29,6 +29,8 @@ class EditPointHandle { public unowned EditPoint parent; + public PointType type;+ EditPoint? visual_handle = null; static EditPoint none = new EditPoint ();@@ -37,14 +39,20 @@ class EditPointHandle { this.parent = none; this.angle = 0; this.length = 10;+ this.type = PointType.LINE; } public EditPointHandle (EditPoint parent, double angle, double length) { this.parent = parent; this.angle = angle; this.length = length;+ this.type = PointType.LINE; } + public void set_point_type (PointType point_type) {+ type = point_type;+ }+ public double x () { double r = px (); @@ -825,6 +825,13 @@ class Path { foreach (EditPoint ep in points) { ep.set_active_handle (false); }+ + create_list ();+ + if (points.length () > 2) {+ points.first ().data.recalculate_linear_handles ();+ points.last ().data.recalculate_linear_handles ();+ } } public void reopen () {