Clone in a terminal:
Commit 1a102a5
Johan Mattsson - 2015-06-24T20:34:16+00:00
1a102a5b2220c8756f83fd83f81f03ebb743b60bjohan.mattsson.m@gmail.com

High resolution drawing canvas

Changed files (4)

Diff

diff --git a/libbirdfont/Expander.vala b/libbirdfont/Expander.valaindex 76c4349..d1e992d 100644--- a/libbirdfont/Expander.vala+++ b/libbirdfont/Expander.vala@@ -282,7 +282,6 @@ public class Expander : GLib.Object { 	 		if (unlikely (cached == null)) { 			Context cc;-			 			double text_height = 17 * Toolbox.get_scale (); 			double offset_y = 0; 			diff --git a/libbirdfont/Glyph.vala b/libbirdfont/Glyph.valaindex 6223b0d..605459a 100644--- a/libbirdfont/Glyph.vala+++ b/libbirdfont/Glyph.vala@@ -1729,30 +1729,27 @@ public class Glyph : FontDisplay { 		allocation = a; 	} 	-	public override void draw (WidgetAllocation allocation, Context cr) {+	public override void draw (WidgetAllocation allocation, Context cmp) { 		Tool tool; 			 		this.allocation = allocation;--		ImageSurface ps = new ImageSurface (Format.ARGB32, allocation.width, allocation.height);-		Context cmp = new Context (ps);--		cr.save ();-		draw_background_color (cr, 1);-		cr.restore ();+		+		cmp.save ();+		draw_background_color (cmp, 1);+		cmp.restore (); 		 		if (background_image != null && background_image_visible) {-			((!)background_image).draw (cr, allocation, view_offset_x, view_offset_y, view_zoom);+			((!)background_image).draw (cmp, allocation, view_offset_x, view_offset_y, view_zoom); 		}  		if (unlikely (Preferences.draw_boundaries)) { 			foreach (Path p in get_visible_paths ()) {-				p.draw_boundaries (cr);+				p.draw_boundaries (cmp); 			} 		} 		-		draw_background_glyph (allocation, cr);-		juxtapose (allocation, cr);+		draw_background_glyph (allocation, cmp);+		juxtapose (allocation, cmp);  		if (BirdFont.show_coordinates) { 			draw_coordinate (cmp);@@ -1776,11 +1773,6 @@ public class Glyph : FontDisplay { 		tool = MainWindow.get_toolbox ().get_current_tool (); 		tool.draw_action (tool, cmp, this); 		cmp.restore ();-				-		cr.save ();-		cr.set_source_surface (ps, 0, 0);-		cr.paint ();-		cr.restore (); 	}	  	private void zoom_in_at_point (double x, double y, double amount = 15) {diff --git a/libbirdfont/Renderer/Text.vala b/libbirdfont/Renderer/Text.valaindex ee4f9fe..6bfc7d0 100644--- a/libbirdfont/Renderer/Text.vala+++ b/libbirdfont/Renderer/Text.vala@@ -346,6 +346,7 @@ public class Text : Widget { 			warning ("Base line not zero."); 		} +		// FIXME: cache is disabled for retina testing 		if (use_cached_glyphs) { 			iterate ((glyph, kerning, last) => { 				double end;diff --git a/libbirdfont/Toolbox.vala b/libbirdfont/Toolbox.valaindex 88ff469..305aa33 100644--- a/libbirdfont/Toolbox.vala+++ b/libbirdfont/Toolbox.vala@@ -38,7 +38,7 @@ public class Toolbox : GLib.Object  { 	 	public static int allocation_width = 0; 	public static int allocation_height = 0;-	+		 	/** Scrolling with scroll wheel */ 	bool scrolling_toolbox = false; 	@@ -124,10 +124,10 @@ public class Toolbox : GLib.Object  { 		redraw_tool_box (); 	} -	public static void set_allocation (int w, int h) {-		if (w != allocation_width || allocation_height != h) {-			allocation_width = w;-			allocation_height = h;+	public static void set_allocation (int width, int height) {+		if (width != allocation_width || allocation_height != height) {+			allocation_width = width;+			allocation_height = height; 			Toolbox.redraw_tool_box (); 		} 	}

Contact

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