Commit 3a65e15
Edit current layer in pen tool
Changed files (4)
modifiedlibbirdfont/Color.valamodifiedlibbirdfont/Layer.valamodifiedlibbirdfont/PenTool.valamodifiedlibbirdfont/Svg.vala
Diff
@@ -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;+ } } }@@ -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);+ }+ } } }@@ -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) {@@ -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) {