Clone in a terminal:
Commit 69798ca
Johan Mattsson - 2012-08-04T15:18:49+00:00
69798ca5ea9048acb3fe863dded75fdd2f38f49fjohan.mattsson.m@gmail.com

select correct handle

Changed files (4)

Diff

diff --git a/src/Argument.vala b/src/Argument.valaindex fcf0f21..1377d11 100644--- a/src/Argument.vala+++ b/src/Argument.vala@@ -52,8 +52,6 @@ class Argument : GLib.Object { 				a = expand_param (a); 			} 			-			print (@"\"$a\"\n");-			 			// valid parameter 			if (a == "--autosave" || a == "--exit" || a == "--slow" || a == "--help" || a == "--test") { 				prev = a;diff --git a/src/Path.vala b/src/Path.valaindex d4e11a2..138c7c6 100644--- a/src/Path.vala+++ b/src/Path.vala@@ -996,9 +996,6 @@ class Path { 		ymax = tymax; 		ymin = tymin; -		// Fixa:-		// print (@"updated \n");- 		if (unlikely (!new_val)) { 			// only one point, what should we do? probably skip it. 		} else if (unlikely (!got_region_boundries ())) {diff --git a/src/PenTool.vala b/src/PenTool.valaindex c32a99b..be697fa 100644--- a/src/PenTool.vala+++ b/src/PenTool.vala@@ -298,7 +298,7 @@ class PenTool : Tool { 		y *= -1;  		set_active_edit_point (null);-		+ 		foreach (Path current_path in g.path_list) { 			if (!current_path.is_editable ()) { 				continue;@@ -307,7 +307,7 @@ class PenTool : Tool { 			foreach (EditPoint e in current_path.points) { 				d = Math.sqrt (Math.fabs (Math.pow (e.x - x, 2) + Math.pow (e.y - y, 2))); 								-				if (d < m && d * g.view_zoom < 14) {+				if (d < m && d * g.view_zoom < 14 && !is_over_handle (x, y)) { 					m = d; 					set_active_edit_point (e); 				}@@ -454,10 +454,13 @@ class PenTool : Tool { 	public void begin_from_new_point_on_path () { 		begin_new_point_on_path = true; 	}-+	 	private bool is_over_handle (double x, double y) {-		return selected_corner.get_left_handle ().get_point ().is_close (x, y) -		|| selected_corner.get_right_handle ().get_point ().is_close (x, y);+		double dp = selected_corner.get_close_distance (x, y);+		double dl = selected_corner.get_left_handle ().get_point ().get_close_distance (x, y);+		double dr = selected_corner.get_right_handle ().get_point ().get_close_distance (x, y);+		+		return (dl < dp || dr < dp); 	}  	private void curve_active_corner_event (double x, double y) {@@ -465,6 +468,10 @@ class PenTool : Tool { 		 		active_handle.active = false; 		+		if (!is_over_handle (x, y)) {+			return;+		}		+				 		eh = selected_corner.get_left_handle (); 		if (eh.get_point ().is_close (x, y)) { 			eh.active = true;@@ -483,6 +490,10 @@ class PenTool : Tool { 		 		open_closest_path (x, y); 		+		if (!is_over_handle (x, y)) {+			return;+		}+		 		eh = selected_corner.get_left_handle (); 		 		if (eh.get_point ().is_close (x, y)) {diff --git a/src/Scrollbar.vala b/src/Scrollbar.valaindex ae2fdf0..455bcbd 100644--- a/src/Scrollbar.vala+++ b/src/Scrollbar.vala@@ -69,7 +69,6 @@ class Scrollbar : DrawingArea { 	 	public void set_handle_size (double s) { 		height = (s < 0.01) ? 0.01 : s;-		print (@"height $height\n"); 		 		if (height > 1) { 			height = 1;@@ -79,7 +78,6 @@ class Scrollbar : DrawingArea { 	}  	public void set_handle_position (double p) {-		print (@"p: $p\n"); 		pos = (p > 0) ? p : 0; 		y = pos * alloc.height; 	}@@ -88,8 +86,6 @@ class Scrollbar : DrawingArea { 		move = true; 		y_begin = e.y; 		y_last = e.y;-		-		print ("press\n"); 	} 	 	public void button_release (EventButton event) {@@ -101,7 +97,6 @@ class Scrollbar : DrawingArea { 	} 	 	public void motion_notify (EventMotion e) {-		print (@"notify $move \n"); 		double d = 0; 		double dl = 0; 		double m;@@ -130,8 +125,6 @@ class Scrollbar : DrawingArea { 			pos = y / alloc.height; 		} 		-		print (@"pos $pos\n");-		 		if (move) { 			signal_scroll (d / (m - h), dl / (m -h), y / (m - h)); 			pos = y / m;

Contact

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