Clone in a terminal:
Commit 9a60d6a
Johan Mattsson - 2014-07-09T20:46:49+00:00
9a60d6a7dbe0cf8c45ccbdae1f454b362fdd2e5ajohan.mattsson.m@gmail.com

Visual improvement of crop tool

Changed files (2)

Diff

diff --git a/libbirdfont/BackgroundTool.vala b/libbirdfont/BackgroundTool.valaindex 2163eaf..8f396d6 100644--- a/libbirdfont/BackgroundTool.vala+++ b/libbirdfont/BackgroundTool.vala@@ -118,8 +118,8 @@ class BackgroundTool : Tool { 		dx = x - begin_x; 		dy = y - begin_y; 		-		dx *= 1/g.view_zoom;-		dy *= 1/g.view_zoom;+		dx *= 1 / g.view_zoom;+		dy *= 1 / g.view_zoom; 	 		dx *= PenTool.precision; 		dy *= PenTool.precision;diff --git a/libbirdfont/CutBackgroundTool.vala b/libbirdfont/CutBackgroundTool.valaindex 6cef225..aac73ff 100644--- a/libbirdfont/CutBackgroundTool.vala+++ b/libbirdfont/CutBackgroundTool.vala@@ -86,12 +86,24 @@ class CutBackgroundTool : Tool { 		 		draw_action.connect ((self, cr, glyph) => { 			if (is_visible) {+				// draw a border around the selection 				cr.save (); 				cr.set_line_width (2.0);-				cr.set_source_rgba (0, 0, 1, 0.3);+				cr.set_source_rgba (0, 0, 0, 0.3); 				cr.rectangle (fmin (x1, x2), fmin (y1, y2), fabs (x1 - x2), fabs (y1 - y2)); 				cr.stroke (); 				cr.restore ();++				// make the area outside of the selection grey+				cr.save ();+				cr.set_line_width (0);+				cr.set_source_rgba (0, 0, 0, 0.075);+				cr.rectangle (0, 0, glyph.allocation.width, fmin (y1, y2));+				cr.rectangle (0, fmin (y1, y2), fmin (x1, x2), fabs (y1 - y2));+				cr.rectangle (0, fmin (y1, y2) + fabs (y1 - y2), glyph.allocation.width, glyph.allocation.height - fabs (y1 - y2));+				cr.rectangle (fmin (x1, x2) + fabs (x1 - x2), fmin (y1, y2), glyph.allocation.width - fmin (x1, x2) - fabs (x1 - x2), glyph.allocation.height);+				cr.fill ();+				cr.restore (); 			} 		}); 

Contact

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