The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Retina resolution for textarea

These changes was commited to the Birdfont repository Tue, 22 Sep 2015 21:05:37 +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>
Tue, 22 Sep 2015 21:05:37 +0000 (23:05 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Tue, 22 Sep 2015 21:05:37 +0000 (23:05 +0200)
commit f8cb249da3a009dbdf9c30232d7437f214654d25
tree 7c0240c86382678e298d4807775d4225f4fd718b
parent caa33531f79c7f41311759c6911e0a6fd360bf4e
Retina resolution for textarea

libbirdfont/OverViewItem.vala
libbirdfont/Renderer/TextArea.vala
--- a/libbirdfont/OverViewItem.vala +++ b/libbirdfont/OverViewItem.vala @@ -222,7 +222,6 @@ g.add_help_lines (); - gx = 0; gx = ((w / glyph_scale) - glyph_width) / 2 - g.get_left_side_bearing (); gy = (h / glyph_scale) - 25 / glyph_scale; @@ -288,7 +287,7 @@ cc = new Context (cache); cc.scale(Screen.get_scale(), Screen.get_scale()); - cc.rectangle (0, 0, width - 1, 20 - 1); + cc.rectangle (0, 0, width, 20 - 1); p = new Cairo.Pattern.linear (0.0, 0, 0.0, 20); Theme.gradient (p, "Overview Item 1", "Overview Item 2"); cc.set_source (p); @@ -307,7 +306,7 @@ cc = new Context (cache); cc.scale(Screen.get_scale(), Screen.get_scale()); - cc.rectangle (0, 0, width - 1, 20 - 1); + cc.rectangle (0, 0, width, 20 - 1); Theme.color (cc, "Selected Overview Item");
--- a/libbirdfont/Renderer/TextArea.vala +++ b/libbirdfont/Renderer/TextArea.vala @@ -1198,9 +1198,10 @@ ty = paragraph.start_y; if (paragraph.cached_surface == null) { - paragraph.cached_surface = new Surface.similar (cr.get_target (), Cairo.Content.COLOR_ALPHA, (int) width + 2, paragraph.get_height () + (int) font_size + 2); + paragraph.cached_surface = Screen.create_background_surface ((int) width + 2, paragraph.get_height () + (int) font_size + 2); cc = new Context ((!) paragraph.cached_surface); - + cc.scale (Screen.get_scale(), Screen.get_scale()); + foreach (Text next_word in paragraph.words) { if (next_word.text != "\n") { next_word.draw_at_top (cc, next_word.widget_x, next_word.widget_y - ty); @@ -1210,8 +1211,10 @@ if (likely (paragraph.cached_surface != null)) { // FIXME: subpixel offset in text area - cr.set_source_surface ((!) paragraph.cached_surface, (int) (x + tx), (int) (widget_y + paragraph.start_y - font_size + padding)); - cr.paint (); + Screen.paint_background_surface(cr, + (!) paragraph.cached_surface, + (int) (x + tx), + (int) (widget_y + paragraph.start_y - font_size + padding)); } else { warning ("No paragraph image."); }