The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Visibility for layers in SVG import

These changes was commited to the Birdfont repository Mon, 18 May 2015 12:55:20 +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>
Mon, 18 May 2015 12:55:20 +0000 (14:55 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Mon, 18 May 2015 12:55:20 +0000 (14:55 +0200)
commit 9a149ee152911a4c4c3e744ebae3de0784c05820
tree 355410fe5f25aeaa56de00a341eaf5aa45b4c65a
parent c7947bb21cfa86d3c877b756c98882d1b41b898b
Visibility for layers in SVG import

libbirdfont/SvgParser.vala
--- a/libbirdfont/SvgParser.vala +++ b/libbirdfont/SvgParser.vala @@ -193,7 +193,24 @@ private void parse_layer (Tag tag, Layer pl) { Layer layer; + bool hidden = false; + + foreach (Attribute attr in tag.get_attributes ()) { + if (attr.get_name () == "display" && attr.get_content () == "none") { + hidden = true; + } + + if (attr.get_name () == "visibility" + && (attr.get_content () == "hidden" + || attr.get_content () == "collapse")) { + hidden = true; + } + } + if (hidden) { + return; + } + foreach (Tag t in tag) { if (t.get_name () == "path") { parse_path (t, pl);