Commit 5e0a131
Hide SVG layers
Changed files (4)
modifiedlibbirdfont/Glyph.valamodifiedlibsvgbird/Layer.valamodifiedlibsvgbird/SvgFile.valamodifiedlibsvgbird/SvgStyle.vala
Diff
@@ -1386,7 +1386,7 @@ public class Glyph : FontDisplay { } warning (@"No line with label $name found");- return new Line ("Err");+ return new Line ("Error"); } public override void zoom_in () {@@ -1591,7 +1591,11 @@ public class Glyph : FontDisplay { public void draw_layers (Context cr) { foreach (SvgBird.Object object in layers.objects) { if (object is Layer) {- draw_layer (cr, (Layer) object);+ Layer layer = (Layer) object;+ + if (layer.visible) {+ draw_layer (cr, layer);+ } } } @@ -1602,7 +1606,10 @@ public class Glyph : FontDisplay { foreach (SvgBird.Object object in sublayers.objects) { if (object is EmbeddedSvg) { EmbeddedSvg svg = (EmbeddedSvg) object;- svg.draw_embedded_svg (cr);+ + if (svg.visible) {+ svg.draw_embedded_svg (cr);+ } } } }@@ -131,7 +131,6 @@ public class Layer : Object { } stdout.printf (@" $(transforms) $(style)");- stdout.printf (@"\n"); foreach (Object object in objects) {@@ -294,7 +294,7 @@ public class SvgFile : GLib.Object { object.clip_path = get_clip_path (attributes); object.transforms = get_transform (attributes); object.style = SvgStyle.parse (drawing.defs, parent_style, tag);- object.visible = is_visible (tag);+ object.visible = is_visible (tag); // FIXME: add style fill none } ClipPath? get_clip_path (Attributes attributes) {@@ -227,8 +227,6 @@ public class SvgStyle : GLib.Object { if (d != null) { Defs defs = (!) d;-- print (s.style.get ("fill") + "\n"); s.stroke_gradient = defs.get_gradient_for_url (s.style.get ("stroke")); s.fill_gradient = defs.get_gradient_for_url (s.style.get ("fill"));