Clone in a terminal:
Commit f8cb249
Johan Mattsson - 2015-09-22T21:05:37+00:00
f8cb249da3a009dbdf9c30232d7437f214654d25johan.mattsson.m@gmail.com

Retina resolution for textarea

Changed files (2)

Diff

diff --git a/libbirdfont/OverViewItem.vala b/libbirdfont/OverViewItem.valaindex 2b44c73..01ee72d 100644--- a/libbirdfont/OverViewItem.vala+++ b/libbirdfont/OverViewItem.vala@@ -222,7 +222,6 @@ public class OverViewItem : GLib.Object {  			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 @@ public class OverViewItem : GLib.Object { 		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 @@ public class OverViewItem : GLib.Object { 		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"); 			diff --git a/libbirdfont/Renderer/TextArea.vala b/libbirdfont/Renderer/TextArea.valaindex 3a0fd9e..1be9eda 100644--- a/libbirdfont/Renderer/TextArea.vala+++ b/libbirdfont/Renderer/TextArea.vala@@ -1198,9 +1198,10 @@ public class TextArea : Widget { 			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 @@ public class TextArea : Widget { 			 			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."); 			}

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112