The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Select all birdfont paths

These changes was commited to the Birdfont repository Sun, 17 Jan 2016 23:01:46 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 17 Jan 2016 23:01:46 +0000 (00:01 +0100)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 17 Jan 2016 23:02:24 +0000 (00:02 +0100)
commit 9e59597625f51ee3ec42b2b2f7f5804506531faa
tree 0f5916bb1fadfea537a7aba9e7b2629340f800a3
parent 64f3f8c08f52faabdf409d9202896d6ca2fb7662
Select all birdfont paths

libbirdfont/LayerUtils.vala
libbirdfont/Path.vala
--- a/libbirdfont/LayerUtils.vala +++ b/libbirdfont/LayerUtils.vala @@ -41,17 +41,20 @@ } public static PathList get_all_paths (Layer layer) { - ObjectGroup objects = layer.objects; PathList paths = new PathList (); - - foreach (SvgBird.Object o in objects) { + add_paths_to_group (layer, paths); + return paths; + } + + public static void add_paths_to_group (Layer layer, PathList paths) { + foreach (SvgBird.Object o in layer.objects) { if (o is PathObject) { PathObject p = (PathObject) o; paths.add (p.get_path ()); + } else if (o is Layer) { + add_visible_paths_to_group ((Layer) o, paths); } } - - return paths; } public static PathList get_visible_paths (Layer layer) { @@ -62,11 +65,13 @@ public static void add_visible_paths_to_group (Layer layer, PathList paths) { foreach (SvgBird.Object o in layer.objects) { - if (o is PathObject) { - PathObject p = (PathObject) o; - paths.add (p.get_path ()); - } else if (o is Layer) { - add_visible_paths_to_group ((Layer) o, paths); + if (o.visible) { + if (o is PathObject) { + PathObject p = (PathObject) o; + paths.add (p.get_path ()); + } else if (o is Layer) { + add_visible_paths_to_group ((Layer) o, paths); + } } } }
--- a/libbirdfont/Path.vala +++ b/libbirdfont/Path.vala @@ -275,12 +275,6 @@ } else if (color != null) { c = (!) color; cr.set_source_rgba (c.r, c.g, c.b, c.a); - } else { - if (is_clockwise ()) { - Theme.color_opacity (cr, "Selected Objects", 0.4); - } else { - Theme.color_opacity (cr, "Selected Objects", 0.8); - } } }