The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Hide SVG layers

These changes was commited to the Birdfont repository Thu, 10 Mar 2016 11:59:22 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Thu, 10 Mar 2016 11:59:22 +0000]

Updated Files

libbirdfont/Glyph.vala
libsvgbird/Layer.vala
libsvgbird/SvgFile.vala
libsvgbird/SvgStyle.vala
--- a/libbirdfont/Glyph.vala +++ b/libbirdfont/Glyph.vala @@ -1386,7 +1386,7 @@ } 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 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 @@ 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); + } } } }
--- a/libsvgbird/Layer.vala +++ b/libsvgbird/Layer.vala @@ -131,7 +131,6 @@ } stdout.printf (@" $(transforms) $(style)"); - stdout.printf (@"\n"); foreach (Object object in objects) {
--- a/libsvgbird/SvgFile.vala +++ b/libsvgbird/SvgFile.vala @@ -294,7 +294,7 @@ 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) {
--- a/libsvgbird/SvgStyle.vala +++ b/libsvgbird/SvgStyle.vala @@ -227,8 +227,6 @@ 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"));