The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Clear glyph cache in overview

These changes was commited to the Birdfont repository Sun, 19 Jun 2016 13:23:32 +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, 19 Jun 2016 13:23:32 +0000 (15:23 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 19 Jun 2016 13:23:32 +0000 (15:23 +0200)
commit c7b9ee4f6335f9aea851d1dc2a13e3b341d67841
tree dfeac0a70b85a70e92f06ef5903229b4742a7fa4
parent 30ab0d5a9cf8116f54b7288fe9982101936fffd2
Clear glyph cache in overview

libbirdfont/OverView.vala
libbirdfont/OverViewItem.vala
--- a/libbirdfont/OverView.vala +++ b/libbirdfont/OverView.vala @@ -421,8 +421,17 @@ OverViewItem.margin = OverViewItem.DEFAULT_MARGIN * z; update_item_list (); OverViewItem.reset_label (); - GlyphCanvas.redraw (); Preferences.set ("overview_zoom", @"$zoom"); + + Font font = BirdFont.get_current_font (); + for (int index = 0; index < font.length (); index++) { + GlyphCollection? glyphs = font.get_glyph_collection_index ((uint32) index); + return_if_fail (glyphs != null); + GlyphCollection g = (!) glyphs; + g.get_current ().overview_thumbnail = null; + } + + GlyphCanvas.redraw (); } public override void zoom_min () {
--- a/libbirdfont/OverViewItem.vala +++ b/libbirdfont/OverViewItem.vala @@ -102,7 +102,7 @@ g = ((!) glyphs).get_current (); - if (g.overview_thumbnail != null) { + if (likely (g.overview_thumbnail != null)) { cache = g.overview_thumbnail; return; } @@ -135,6 +135,8 @@ c.restore (); cache = s; + g.overview_thumbnail = s; + GlyphCanvas.redraw (); }