The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Fix duplicated grid buttons

These changes was commited to the Birdfont repository Thu, 13 Dec 2018 13:29: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
[Thu, 13 Dec 2018 13:29:46 +0000]

Updated Files

libbirdfont/BirdFontFile.vala
--- a/libbirdfont/BirdFontFile.vala +++ b/libbirdfont/BirdFontFile.vala @@ -1195,12 +1195,24 @@ font.background_scale = attr.get_content (); } } + } + + private bool has_grid (string v) { + foreach (string g in font.grid_width) { + if (g == v) { + return true; + } + } + + return false; } private void parse_grid (Tag tag) { foreach (Attribute attr in tag.get_attributes ()) { - if (attr.get_name () == "width") { - font.grid_width.add (attr.get_content ()); + string v = attr.get_content (); + + if (attr.get_name () == "width" && !has_grid (v)) { + font.grid_width.add (v); } } }