Clone in a terminal:
Commit 3a65e15
Johan Mattsson - 2015-06-09T21:01:58+00:00
3a65e1546226085370dc9a0509fc8e383107ff3bjohan.mattsson.m@gmail.com

Edit current layer in pen tool

Changed files (4)

Diff

diff --git a/libbirdfont/Color.vala b/libbirdfont/Color.valaindex 03cc622..b9e5543 100644--- a/libbirdfont/Color.vala+++ b/libbirdfont/Color.vala@@ -116,6 +116,14 @@ public class Color { 	public Color copy () { 		return new Color (r, g, b, a); 	}++	public string to_rgb_hex () {+		string s = "#";+		s += Font.to_hex_code ((unichar) Math.rint (r  * 254));+		s += Font.to_hex_code ((unichar) Math.rint (g  * 254));+		s += Font.to_hex_code ((unichar) Math.rint (b  * 254));+		return s;+	} }  }diff --git a/libbirdfont/Layer.vala b/libbirdfont/Layer.valaindex e722110..aef827b 100644--- a/libbirdfont/Layer.vala+++ b/libbirdfont/Layer.vala@@ -19,6 +19,7 @@ public class Layer : GLib.Object { 	public Gee.ArrayList<Layer> subgroups; 	public bool visible = true; 	public string name = "Layer";+	public bool is_counter = false; 	 	public Layer () { 		paths = new PathList ();@@ -84,6 +85,16 @@ public class Layer : GLib.Object { 		 		return layer; 	}+	+	public void print (int indent = 0) {+		foreach (Layer l in subgroups) {+			for (int i = 0; i < indent; i++) {+				stdout.printf ("\t");+			}+			stdout.printf ("%s\n", l.name);			+			l.print (indent + 1);+		}+	} }  }diff --git a/libbirdfont/PenTool.vala b/libbirdfont/PenTool.valaindex 2071ae9..9d72a54 100644--- a/libbirdfont/PenTool.vala+++ b/libbirdfont/PenTool.vala@@ -28,13 +28,9 @@ public class PenTool : Tool {  	public static bool move_selected = false; 	public static bool move_selected_handle = false;- 	public static bool move_point_on_path = false;- 	public static bool edit_active_corner = false;- 	public static bool move_point_independent_of_handle = false;-	 	public static Gee.ArrayList<PointSelection> selected_points;   	public static EditPointHandle active_handle;@@ -1650,7 +1646,7 @@ public class PenTool : Tool { 		 		path = null; 		-		foreach (Path current_path in g.get_visible_paths ()) {+		foreach (Path current_path in g.get_paths_in_current_layer ()) { 			if (is_close_to_path (current_path, ex, ey)) { 				foreach (EditPoint e in current_path.points) { 					nd = e.get_distance (x, y);@@ -1918,7 +1914,7 @@ public class PenTool : Tool { 		EditPoint parent_point; 		EditPoint tied_point; 		-		foreach (Path p in g.get_visible_paths ()) {+		foreach (Path p in g.get_paths_in_current_layer ()) { 			if (is_close_to_path (p, event_x, event_y) || p == active_path) { 				foreach (EditPoint ep in p.points) { 					if (ep.is_selected () || Path.show_all_line_handles) {diff --git a/libbirdfont/Svg.vala b/libbirdfont/Svg.valaindex d2e2e5e..6cddb54 100644--- a/libbirdfont/Svg.vala+++ b/libbirdfont/Svg.vala@@ -16,7 +16,7 @@ using Cairo;  namespace BirdFont { -class Svg {+public class Svg {  	/** Export to svg glyph data. */ 	public static string to_svg_glyph (Glyph g) {	

Contact

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