Clone in a terminal:
Commit 404faa7
Johan Mattsson - 2014-09-03T19:25:56+00:00
404faa7687c72853de5cf9c75abab566c13cc406johan.mattsson.m@gmail.com

Resize tab content

Changed files (3)

Diff

diff --git a/birdfont/GtkWindow.vala b/birdfont/GtkWindow.valaindex 985eb7e..a47cd7e 100644--- a/birdfont/GtkWindow.vala+++ b/birdfont/GtkWindow.vala@@ -1190,7 +1190,6 @@ class ToolboxCanvas : DrawingArea { public class GlyphCanvasArea : DrawingArea  { 	GlyphCanvas glyph_canvas; 	WidgetAllocation alloc = new WidgetAllocation ();-	WidgetAllocation prev_alloc = new WidgetAllocation (); 	 	public GlyphCanvasArea (GlyphCanvas gc) { 		int event_flags;@@ -1214,21 +1213,12 @@ public class GlyphCanvasArea : DrawingArea  { 			get_allocation (out allocation); 			 			alloc = new WidgetAllocation ();-+			 			alloc.width = allocation.width; 			alloc.height = allocation.height; 			alloc.x = allocation.x; 			alloc.y = allocation.y; 			-			glyph_canvas.set_allocation (alloc);-			BirdFont.current_glyph.resized (alloc);-				-			prev_alloc = new WidgetAllocation ();-			prev_alloc.width = allocation.width;-			prev_alloc.height = allocation.height;-			prev_alloc.x = allocation.x;-			prev_alloc.y = allocation.y;-			 			Context cw = cairo_create (get_window()); 			 			Surface s = new Surface.similar (cw.get_target (), Cairo.Content.COLOR_ALPHA, alloc.width, alloc.height);diff --git a/libbirdfont/GlyphCanvas.vala b/libbirdfont/GlyphCanvas.valaindex 5293b25..4e5453e 100644--- a/libbirdfont/GlyphCanvas.vala+++ b/libbirdfont/GlyphCanvas.vala@@ -32,7 +32,7 @@ public class GlyphCanvas : GLib.Object { 		return allocation; 	} 
-	public void set_allocation (WidgetAllocation w) {
+	public static void set_allocation (WidgetAllocation w) {
 		allocation = w.copy ();
 	}
 
diff --git a/libbirdfont/TabContent.vala b/libbirdfont/TabContent.valaindex b1aea12..fa11230 100644--- a/libbirdfont/TabContent.vala+++ b/libbirdfont/TabContent.vala@@ -66,6 +66,8 @@ public class TabContent : GLib.Object { 			cr.fill (); 			cr.restore (); 		} else {+			GlyphCanvas.set_allocation (allocation);+			BirdFont.current_glyph.resized (allocation); 			GlyphCanvas.current_display.draw (allocation, cr); 		} 	}

Contact

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