Clone in a terminal:
Commit 4b2c5c4
Johan Mattsson - 2012-07-13T12:17:39+00:00
4b2c5c4d9a1133fdb2cbb6f997c224a1ad9bb992johan.mattsson.m@gmail.com

linear handles for next point

Changed files (3)

Diff

diff --git a/src/EditPoint.vala b/src/EditPoint.valaindex d90b32d..90382da 100644--- a/src/EditPoint.vala+++ b/src/EditPoint.vala@@ -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);+			} 		} 	} 	diff --git a/src/EditPointHandle.vala b/src/EditPointHandle.valaindex 3e591f0..1ad5783 100644--- a/src/EditPointHandle.vala+++ b/src/EditPointHandle.vala@@ -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 (); 		diff --git a/src/Path.vala b/src/Path.valaindex c119d32..d207072 100644--- a/src/Path.vala+++ b/src/Path.vala@@ -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 () {

Contact

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