Clone in a terminal:
Commit 64f3f8c
Johan Mattsson - 2016-01-17T22:39:59+00:00
64f3f8c08f52faabdf409d9202896d6ca2fb7662johan.mattsson.m@gmail.com

Draw transparent objects when point tools are used

Changed files (2)

Diff

diff --git a/libbirdfont/Glyph.vala b/libbirdfont/Glyph.valaindex 0887b56..76fe075 100644--- a/libbirdfont/Glyph.vala+++ b/libbirdfont/Glyph.vala@@ -1613,37 +1613,43 @@ public class Glyph : FontDisplay { 			|| (selected_tool is BezierTool);  		bool has_path = false;-		foreach (SvgBird.Object object in get_visible_objects ()) {-			if (object is PathObject-				&& object.stroke > 0) {-					-				has_path = true;-				PathObject object_path = (PathObject) object;				-				object_path.draw_outline (cr);+		+		if (!draw_control_points) {+			foreach (SvgBird.Object object in get_visible_objects ()) {+				if (object is PathObject+					&& object.stroke > 0) {+						+					has_path = true;+					PathObject object_path = (PathObject) object;				+					object_path.draw_path (cr);+				} 			}-		} -		if (has_path) {-			cr.set_fill_rule (FillRule.WINDING);-			cr.set_source_rgba (0, 0, 0, 1);-			cr.fill ();+			if (has_path) {+				cr.set_fill_rule (FillRule.WINDING);+				cr.set_source_rgba (0, 0, 0, 1);+				cr.fill ();+			} 		}-+		 		has_path = false;-		foreach (SvgBird.Object object in get_visible_objects ()) {-			if (object is PathObject-				&& object.stroke == 0) {-					-				has_path = true;-				PathObject object_path = (PathObject) object;				-				object_path.draw_outline (cr);+		+		if (!draw_control_points) {+			foreach (SvgBird.Object object in get_visible_objects ()) {+				if (object is PathObject+					&& object.stroke == 0) {+						+					has_path = true;+					PathObject object_path = (PathObject) object;				+					object_path.draw_path (cr);+				} 			}-		} -		if (has_path) {-			cr.set_fill_rule (FillRule.EVEN_ODD);-			Theme.color (cr, "Objects");-			cr.fill ();+			if (has_path) {+				cr.set_fill_rule (FillRule.EVEN_ODD);+				Theme.color (cr, "Objects");+				cr.fill ();+			} 		} 		 		if (draw_control_points) {@@ -1652,7 +1658,7 @@ public class Glyph : FontDisplay { 					PathObject object_path = (PathObject) object; 					Glyph g = MainWindow.get_current_glyph (); 					cr.set_line_width (CanvasSettings.stroke_width / g.view_zoom);-					object_path.path.draw_outline (cr);+					object_path.path.draw_path (cr); 					object_path.path.draw_control_points (cr); 				} 			}@@ -1709,7 +1715,6 @@ public class Glyph : FontDisplay { 		}  		draw_background_glyph (allocation, cmp);- 		juxtapose (allocation, cmp);  		if (BirdFont.show_coordinates) {diff --git a/libbirdfont/PathObject.vala b/libbirdfont/PathObject.valaindex 2491221..f83d467 100644--- a/libbirdfont/PathObject.vala+++ b/libbirdfont/PathObject.vala@@ -102,9 +102,11 @@ public class PathObject : SvgBird.Object { 	} 	 	public override void draw_outline (Context cr) {-		PathList pl = new PathList ();-		pl.add (path);-		draw_path_list (pl, cr);+		// drawing is handled in Glyph.draw_bird_font_paths+	}+	+	public void draw_path (Context cr) {+		path.draw_path (cr); 	}  	public static void draw_path_list (PathList pl, Context cr) {

Contact

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