Clone in a terminal:
Commit 7dd0ecf
Johan Mattsson - 2012-09-15T20:29:51+00:00
7dd0ecf647cdc5c8060991b13802a154394ecdfdjohan.mattsson.m@gmail.com

bugfix: reject points at nan

Changed files (2)

Diff

diff --git a/src/EditPoint.vala b/src/EditPoint.valaindex eef0810..031e5ac 100644--- a/src/EditPoint.vala+++ b/src/EditPoint.vala@@ -71,6 +71,12 @@ class EditPoint { 	 		right_handle = new EditPointHandle (this, 0, 7); 		left_handle = new EditPointHandle (this, PI, 7);++		if (unlikely (nx.is_nan () || ny.is_nan ())) {+			warning (@"Invalid point at ($nx,$ny).");+			x = 0;+			y = 0;+		} 	}  	/** Flip handles if next point on path is in the other direction. @@ -321,6 +327,12 @@ class EditPoint { 	public void set_position (double tx, double ty) { 		x = tx; 		y = ty;++		if (unlikely (tx.is_nan () || ty.is_nan ())) {+			warning (@"Invalid point at ($tx,$ty).");+			x = 0;+			y = 0;+		} 	} 	 	public static void to_coordinate (ref double x, ref double y) {diff --git a/src/EditPointHandle.vala b/src/EditPointHandle.valaindex 7dcbc38..be92256 100644--- a/src/EditPointHandle.vala+++ b/src/EditPointHandle.vala@@ -69,6 +69,7 @@ class EditPointHandle  { 		 		if (unlikely (r <= -100000)) { 			print_position ();+			move_to (0, 0); 		} 	 		return r;@@ -79,6 +80,7 @@ class EditPointHandle  { 		 		if (unlikely (r <= -100000)) { 			print_position ();+			move_to (0, 0); 		} 		 		return r;

Contact

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