The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Cache overview items

These changes was commited to the Birdfont repository Fri, 18 Dec 2015 20:38:19 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Fri, 18 Dec 2015 20:38:19 +0000]

Updated Files

libbirdfont/Glyph.vala
libbirdfont/OverViewItem.vala
--- a/libbirdfont/Glyph.vala +++ b/libbirdfont/Glyph.vala @@ -138,6 +138,8 @@ public double top_limit = 0; public double baseline = 0; public double bottom_limit = 0; + + public Surface? overview_thumbnail = null; public Glyph (string name, unichar unichar_code = 0) { this.name = name; @@ -454,6 +456,7 @@ TimeoutSource input_delay; ttf_data = null; // recreate quatradic path on export + overview_thumbnail = null; ignore_input = true; // make sure that tripple clicks in overview are ignored
--- a/libbirdfont/OverViewItem.vala +++ b/libbirdfont/OverViewItem.vala @@ -95,7 +95,7 @@ if (glyphs == null) { return; } - + Glyph g; Font font; double gx, gy; @@ -106,6 +106,13 @@ Surface s; Context c; Color color = Color.black (); + + g = ((!) glyphs).get_current (); + + if (g.overview_thumbnail != null) { + cache = g.overview_thumbnail; + return; + } w = width; h = height; @@ -114,8 +121,6 @@ s = Screen.create_background_surface ((int) width, (int) height - 20); c = new Context (s); - - g = ((!) glyphs).get_current (); c.save (); g.boundaries (out x1, out y1, out x2, out y2);