Clone in a terminal:
Commit e24d059
Johan Mattsson - 2012-10-02T12:25:14+00:00
e24d059429bd2767aea05c82778691180056999djohan.mattsson.m@gmail.com

set color for selected path

Changed files (3)

Diff

diff --git a/src/Glyph.vala b/src/Glyph.valaindex a27edc3..dd276b3 100644--- a/src/Glyph.vala+++ b/src/Glyph.vala@@ -1301,9 +1301,13 @@ class Glyph : FontDisplay { 			foreach (unowned Path p in path_list) { 				p.draw_outline (cr, allocation, view_zoom); 				p.draw_edit_points (cr, allocation, view_zoom);-				+			}+		}++		if (!is_open ()) {+			foreach (unowned Path p in active_paths) { 				if (!p.is_editable ()) {-					// p.fill_path (cr, allocation, view_zoom);+					p.fill_path (cr, allocation, view_zoom); 				} 			} 		}diff --git a/src/MoveTool.vala b/src/MoveTool.valaindex 8a40be2..2e70822 100644--- a/src/MoveTool.vala+++ b/src/MoveTool.vala@@ -32,13 +32,7 @@ class MoveTool : Tool {  		deselect_action.connect((self) => { 			Glyph glyph = MainWindow.get_current_glyph ();- 			glyph.clear_active_paths ();--			foreach (Path p in glyph.path_list) {-				p.set_color (0, 0, 0, 1);-				p.set_selected (false);-			} 		}); 				 		press_action.connect((self, b, x, y) => {@@ -53,22 +47,7 @@ class MoveTool : Tool { 			} 			 			move_path = true;-			-			foreach (Path p in glyph.path_list) {-				p.set_color (0, 0, 0, 1);-				p.set_selected (false);-			}-			-			foreach (Path path in glyph.active_paths) {-				if (path.is_clockwise ()) {-					path.set_color (0.2, 0.2, 0.4, 0.8);-					path.set_selected (true);-				} else {-					path.set_color (0.5, 0.5, 0.7, 0.8);-					path.set_selected (true);-				}-			}-					+				 			last_x = x; 			last_y = y; 		});diff --git a/src/Path.vala b/src/Path.valaindex f040ce3..178b90f 100644--- a/src/Path.vala+++ b/src/Path.vala@@ -47,11 +47,6 @@ class Path { 	bool clockwise_direction = true;  	public delegate bool RasterIterator (double x, double y, double step); // iterate over each pixel at a given zoom level--	public double r = 0;-	public double g = 0;-	public double b = 0;-	public double a = 1; 	 	bool selected = false; 	@@ -77,13 +72,6 @@ class Path { 		} 	} -	public void set_color (double r, double g, double b, double a) {-		this.r = r;-		this.g = g;-		this.b = b;-		this.a = a;-	}- 	public bool empty () { 		return points.length () == 0; 	}@@ -176,7 +164,13 @@ class Path {  		// fill path 		cr.close_path ();-		cr.set_source_rgba (r, g, b, a);+			+		if (is_clockwise ()) {+			cr.set_source_rgba (80/255.0, 95/255.0, 137/255.0, 0.5);+		} else {+			cr.set_source_rgba (144/255.0, 145/255.0, 236/255.0, 0.5);+		}+		 		cr.fill (); 	} 

Contact

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