Clone in a terminal:
Commit 25fe43f
Johan Mattsson - 2015-06-07T17:30:59+00:00
25fe43f9a6e7ebc6022b4b2a2ada6bf9081244dcjohan.mattsson.m@gmail.com

Fix path selection

Changed files (3)

Diff

diff --git a/libbirdfont/ColorPicker.vala b/libbirdfont/ColorPicker.valaindex 2a46c59..7e40758 100644--- a/libbirdfont/ColorPicker.vala+++ b/libbirdfont/ColorPicker.vala@@ -63,7 +63,6 @@ public class ColorPicker : Tool { 	} 	 	public void set_color_from_pointer (double tx) {-		 		if (tx > Toolbox.allocation_width) { 			tx = Toolbox.allocation_width; 		}diff --git a/libbirdfont/Glyph.vala b/libbirdfont/Glyph.valaindex 50feeee..4ef3895 100644--- a/libbirdfont/Glyph.vala+++ b/libbirdfont/Glyph.vala@@ -1091,7 +1091,21 @@ public class Glyph : FontDisplay { 		y = (y + g.view_offset_y - yc ()) * g.view_zoom;	 		return -y; 	}-	++	public Path? get_path_at (double x, double y) {+		Path? p = null;+		bool found = false;+		+		foreach (Path pt in get_paths_in_current_layer ()) {+			if (pt.is_over (x, y)) {+				p = pt;+				found = true;+			}+		}+		+		return p;+	}+		 	public bool select_path (double x, double y) { 		Path? p = null; 		bool found = false;diff --git a/libbirdfont/MoveTool.vala b/libbirdfont/MoveTool.valaindex 3b61cb7..2e7f274 100644--- a/libbirdfont/MoveTool.vala+++ b/libbirdfont/MoveTool.vala@@ -165,14 +165,28 @@ public class MoveTool : Tool { 		 	public void press (int b, int x, int y) { 		Glyph glyph = MainWindow.get_current_glyph ();-					+		Path? p;+		bool selected = false;+		 		glyph.store_undo_state (); 		group_selection = false;-				-		if (!glyph.is_over_selected_path (x, y)) {-			if (!glyph.select_path (x, y)) {+		+		p = glyph.get_path_at (x, y);+		+		if (p != null) {+			selected = glyph.active_paths.contains ((!) p);+			+			if (!selected && !KeyBindings.has_shift ()) { 				glyph.clear_active_paths ();+			} +			+			if (selected && KeyBindings.has_shift ()) {+				glyph.active_paths.remove ((!) p);+			} else {+				glyph.add_active_path ((!) p); 			}+		} else if (!KeyBindings.has_shift ()) {+			glyph.clear_active_paths (); 		} 		 		move_path = true;@@ -190,6 +204,7 @@ public class MoveTool : Tool { 		 		update_boundaries_for_selection (); 		selection_changed ();+		GlyphCanvas.redraw (); 	} 	 	

Contact

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