Clone in a terminal:
Commit e6e2585
Johan Mattsson - 2012-10-27T12:29:27+00:00
e6e258558041683e136bfb23a4af45e9d161208ejohan.mattsson.m@gmail.com

resize handle

Changed files (1)

Diff

diff --git a/src/MoveTool.vala b/src/MoveTool.valaindex 5cebd7a..91f5232 100644--- a/src/MoveTool.vala+++ b/src/MoveTool.vala@@ -46,17 +46,25 @@ class MoveTool : Tool { 		}); 				 		press_action.connect((self, b, x, y) => {-			double handle_x, handle_y; 			Glyph glyph = MainWindow.get_current_glyph (); 						 			glyph.store_undo_state (); 			 			foreach (Path p in glyph.active_paths) {-				is_over_resize_handle (p, x, y);+				if (is_over_resize_handle (p, x, y)) {+					resize_path = true;+					resized_path = p;+					last_resize_y = y;+					return;+				} 			} 			 			if (resized_path != null) {-				is_over_resize_handle ((!) resized_path, x, y);+				if (is_over_resize_handle ((!) resized_path, x, y)) {+					resize_path = true;+					last_resize_y = y;+					return;					+				} 			} 			 			if (!glyph.is_over_selected_path (x, y)) {@@ -104,7 +112,7 @@ class MoveTool : Tool { 				h = rp.xmax - rp.xmin; 				 				ratio = 1;-				ratio -= p * (Glyph.path_coordinate_y (last_resize_y) - Glyph.path_coordinate_y (y)) / h;+				ratio -= 0.7 * p * (Glyph.path_coordinate_y (last_resize_y) - Glyph.path_coordinate_y (y)) / h; 				 				rp.resize (ratio); 				last_resize_y = y;@@ -143,15 +151,10 @@ class MoveTool : Tool { 		}); 	} -	void is_over_resize_handle (Path p, double x, double y) {+	bool is_over_resize_handle (Path p, double x, double y) { 		double handle_x = Math.fabs (Glyph.reverse_path_coordinate_x (p.xmax));  		double handle_y = Math.fabs (Glyph.reverse_path_coordinate_y (p.ymax));-	-		if (fabs (handle_x - x + 10) < 20 && fabs (handle_y - y + 10) < 20) {-			resize_path = true;-			resized_path = p;-			last_resize_y = y;-		}		+		return fabs (handle_x - x + 10) < 20 && fabs (handle_y - y + 10) < 20; 	}  	void tie_path_to_grid (Path p, double x, double y) {

Contact

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