Clone in a terminal:
Commit 9fe1b5d
Johan Mattsson - 2014-02-10T19:12:29+00:00
9fe1b5d0a426be08938ebe3ca337863f36c25ad4johan.mattsson.m@gmail.com

Fix color tool on Windows and the missing stroke.

Changed files (5)

Diff

diff --git a/libbirdfont/ColorTool.vala b/libbirdfont/ColorTool.valaindex bfc7954..44f4e5a 100644--- a/libbirdfont/ColorTool.vala+++ b/libbirdfont/ColorTool.vala@@ -37,6 +37,10 @@ public class ColorTool : Tool { 		}); 	} 	+	public void signal_color_updated () {+		color_updated ();+	}+	 	public override void draw (Context cr) { 		double scale = Toolbox.get_scale (); 		double xt = x + w / 2 - 8 * scale;diff --git a/libbirdfont/DrawingTools.vala b/libbirdfont/DrawingTools.valaindex cbd100d..52d8451 100644--- a/libbirdfont/DrawingTools.vala+++ b/libbirdfont/DrawingTools.vala@@ -533,25 +533,24 @@ public class DrawingTools : ToolCollection  { 		 		SpinButton stroke_width; 		stroke_width = new SpinButton ("stroke_width", t_("Stroke width"));-		-		if (Preferences.get ("stroke_width") == "") {-			stroke_width.set_value_round (1);-		} else {-			stroke_width.set_value (Preferences.get ("stroke_width"));-		}-		-		stroke_width.new_value_action.connect((self) => {++		stroke_width.new_value_action.connect ((self) => { 			Glyph g = MainWindow.get_current_glyph (); 			Path.stroke_width = stroke_width.get_value ();-			Path.stroke_width = Math.sqrt (Path.stroke_width); 			g.redraw_area (0, 0, g.allocation.width, g.allocation.height);-			Preferences.set ("stroke_width", @"$(Path.stroke_width)");+			Preferences.set ("stroke_width", stroke_width.get_display_value ()); 			MainWindow.get_toolbox ().redraw ((int) stroke_width.x, (int) stroke_width.y, 70, 70); 		}); 		style_tools.add_tool (stroke_width);+		 		stroke_width.set_max (4); 		stroke_width.set_min (0.2);-+		stroke_width.set_value_round (1);+		+		if (Preferences.get ("stroke_width") != "") {+			stroke_width.set_value (Preferences.get ("stroke_width"));+		}+		 		ColorTool handle_color = new ColorTool (t_("Handle color")); 		handle_color.color_updated.connect (() => { 			Path.handle_color_r = handle_color.color_r;@@ -575,7 +574,6 @@ public class DrawingTools : ToolCollection  {  		// adjust precision 		string precision_value = Preferences.get ("precision");-		 		precision = new SpinButton ("precision", t_("Set precision")); 		 		if (precision_value != "") {@@ -586,7 +584,6 @@ public class DrawingTools : ToolCollection  { 		 		precision.new_value_action.connect ((self) => { 			MainWindow.get_toolbox ().select_tool (precision);-			 			Preferences.set ("precision", self.get_display_value ()); 			MainWindow.get_toolbox ().redraw ((int) precision.x, (int) precision.y, 70, 70); 		});diff --git a/libbirdfont/Icons.vala b/libbirdfont/Icons.valaindex db91bd5..764d691 100644--- a/libbirdfont/Icons.vala+++ b/libbirdfont/Icons.vala@@ -18,7 +18,6 @@ using Cairo;  public class Icons { 	-	public static string directory = "icons"; 	public static bool high_res = true;  	public static int get_dpi () {@@ -26,7 +25,6 @@ public class Icons { 	}  	public static void use_high_resolution (bool high_res) {-		directory = (high_res) ? "icons" : "icons-72dpi"; 		Icons.high_res = high_res; 	} 	@@ -52,7 +50,7 @@ public class Icons { 	}  	public static File find_icon (string name) {-		return FontDisplay.find_file (directory, name);+		return SearchPaths.find_file ("icons", name); 	} } 	diff --git a/libbirdfont/SearchPaths.vala b/libbirdfont/SearchPaths.valaindex 3a63f28..fc0b11e 100644--- a/libbirdfont/SearchPaths.vala+++ b/libbirdfont/SearchPaths.vala@@ -28,7 +28,7 @@ public class SearchPaths { 			 		printd ("Looking for: "); 		printd (resources + "/" + d + "/" + name);-+		 		f = get_file (resources + "/" + d + "/", name); 		if (likely (f.query_exists ())) return f; 		@@ -61,7 +61,7 @@ public class SearchPaths {  		f = get_file ("../" + d + "/", name); 		if (likely (f.query_exists ())) return f;-+		 		f = get_file (".\\" + d + "\\", name); 		if (likely (f.query_exists ())) return f; diff --git a/libbirdfont/SpinButton.vala b/libbirdfont/SpinButton.valaindex b350a22..b97d0d6 100644--- a/libbirdfont/SpinButton.vala+++ b/libbirdfont/SpinButton.vala@@ -194,7 +194,7 @@ public class SpinButton : Tool { 	}  	public void set_value (string new_value, bool check_boundries = true, bool emit_signal = true) {-		string v = new_value;+		string v = new_value.replace (",", ".");  		while (v.char_count () < 5) { 			if (v.index_of (".") == -1) {

Contact

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