Commit 69798ca
select correct handle
Changed files (4)
modifiedsrc/Argument.valamodifiedsrc/Path.valamodifiedsrc/PenTool.valamodifiedsrc/Scrollbar.vala
Diff
@@ -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;@@ -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 ())) {@@ -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)) {@@ -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;