Clone in a terminal:
Commit 603f381
Johan Mattsson - 2015-04-19T12:28:54+00:00
603f38147b54dbdb3f82845236ac629d01b091a1johan.mattsson.m@gmail.com

Hide rotate and resize handle

Changed files (3)

Diff

diff --git a/libbirdfont/Glyph.vala b/libbirdfont/Glyph.valaindex 8e039db..fc21257 100644--- a/libbirdfont/Glyph.vala+++ b/libbirdfont/Glyph.vala@@ -173,7 +173,9 @@ public class Glyph : FontDisplay { 			path = (!) p; 			 			if (Toolbox.get_move_tool ().is_selected ()) {-				Toolbox.set_object_stroke (path.stroke);+				if (path.stroke > 0) {+					Toolbox.set_object_stroke (path.stroke);+				} 			} 			 			if (!active_paths.contains (path)) {diff --git a/libbirdfont/MoveTool.vala b/libbirdfont/MoveTool.valaindex 2fd8a32..6929d2e 100644--- a/libbirdfont/MoveTool.vala+++ b/libbirdfont/MoveTool.vala@@ -234,7 +234,7 @@ public class MoveTool : Tool { 		 		cr.save (); 		-		Theme.color (cr, "Default Background");+		Theme.color (cr, "Foreground 1"); 		cr.set_line_width (2); 		cr.rectangle (x, y, w, h); 		cr.stroke ();diff --git a/libbirdfont/ResizeTool.vala b/libbirdfont/ResizeTool.valaindex 5776153..2c04012 100644--- a/libbirdfont/ResizeTool.vala+++ b/libbirdfont/ResizeTool.vala@@ -129,11 +129,11 @@ public class ResizeTool : Tool { 			Text handle; 			Glyph g = MainWindow.get_current_glyph (); 			-			foreach (Path p in g.active_paths) {+			if (!rotate_path) { 				handle = new Text ("resize_handle", 60 * MainWindow.units); 				handle.load_font ("icons.bf"); 				-				get_reseize_handle_position (p, out handle.widget_x, out handle.widget_y);+				get_reseize_handle_position (out handle.widget_x, out handle.widget_y); 				 				handle.widget_x -= handle.get_sidebearing_extent () / 2; 				handle.widget_y -= handle.get_height () / 2;@@ -142,7 +142,7 @@ public class ResizeTool : Tool { 				handle.draw (cr); 			} 			-			if (g.active_paths.size > 0) {+			if (!resize_path && g.active_paths.size > 0) { 				draw_rotate_handle (cr); 			} 		@@ -154,9 +154,9 @@ public class ResizeTool : Tool { 		}); 	} -	public static void get_reseize_handle_position (Path p, out double px, out double py) {-		px = Glyph.reverse_path_coordinate_x (p.xmax);-		py = Glyph.reverse_path_coordinate_y (p.ymax);+	public static void get_reseize_handle_position (out double px, out double py) {+		px = Glyph.reverse_path_coordinate_x (selection_box_center_x + selection_box_width / 2);+		py = Glyph.reverse_path_coordinate_y (selection_box_center_y + selection_box_height / 2); 	}  	public static double get_rotated_handle_length () {@@ -378,7 +378,7 @@ public class ResizeTool : Tool {  	bool is_over_resize_handle (Path p, double x, double y) { 		double handle_x, handle_y;-		get_reseize_handle_position (p, out handle_x, out handle_y);+		get_reseize_handle_position (out handle_x, out handle_y); 		return Path.distance (handle_x, x, handle_y, y) < 12 * MainWindow.units; 	} 	

Contact

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