Clone in a terminal:
Commit 0f52b39
Johan Mattsson - 2012-10-12T14:14:41+00:00
0f52b39e34082918fd2b300ed5b01b748067ea20johan.mattsson.m@gmail.com

remove some unnecessary code

Changed files (4)

Diff

diff --git a/src/Glyph.vala b/src/Glyph.valaindex dd276b3..ebcb25c 100644--- a/src/Glyph.vala+++ b/src/Glyph.vala@@ -1398,71 +1398,6 @@ class Glyph : FontDisplay { 		cr.paint (); 		cr.restore (); 	}	-	-	private void add_layer (ImageSurface path_image, ImageSurface background_image, Context cr) {-		cr.save ();-		unowned uchar[] pb = background_image.get_data ();-		unowned uchar[] pp = path_image.get_data ();-		int len;--		int bw = background_image.get_width ();-		int bh = background_image.get_height ();--		int pw = path_image.get_width ();-		int ph = path_image.get_height ();-				-		ImageSurface cs = new ImageSurface (Format.ARGB32, pw, ph);-			-		unowned uchar[] img = cs.get_data ();-		-		len = pw * ph * 4;-		int i = 0;-		while (i < len) {-			img[i++] = 0;-		}--		len = pw * ph * 4;-		int pi = 0;-		int bi = 0;-		-		while (true) {-				-			for (int c = 0; c < bw && c < pw; c += 4) {-				switch (pp[c+3]) {-					case 255:-						img[c + pi] = pb[c + bi];-						img[c+1 + pi] = pb[c+1 + bi];-						img[c+2 + pi] = pb[c+2 + bi];-						img[c+3 + pi] = 255;-						break;-					-					default:-						img[c + pi] = pp[c + bi];-						img[c+1 + pi] = pp[c+1 + bi];-						img[c+2 + pi] = pp[c+2 + bi];-						img[c+3 + pi] = 255;-						break;-				}-			}-			-			bi += bw;-			pi += pw;-			-			if (bi >= 4 * bw * bh) {-				break;-			}-			-			if (pi >= 4 * pw * ph) {-				break;-			}-			-		}--		cr.set_source_surface (cs, 0, 0);-	-		cr.paint ();-		cr.restore ();-	}  	private void zoom_in_at_point (double x, double y) { 		int n = -10;diff --git a/src/GlyphBackgroundImage.vala b/src/GlyphBackgroundImage.valaindex cdc79ac..a976be5 100644--- a/src/GlyphBackgroundImage.vala+++ b/src/GlyphBackgroundImage.vala@@ -232,22 +232,6 @@ class GlyphBackgroundImage { 		} 	} 	-	public double get_current_width () {-		return get_img ().get_width () * img_scale_x;-	}--	public double get_current_height () {-		return get_img ().get_height () * img_scale_y;-	}-	-	public void set_img_rotation (double angle) {-		img_rotation = angle;-	}-	-	public double get_img_rotation () {-		return img_rotation;-	}-		 	public void set_img_rotation_from_coordinate (double x, double y) { 		double bcx, bcy; 		double a, b, c, length;@@ -276,25 +260,6 @@ class GlyphBackgroundImage { 		img_scale_y = ys; 	} -	public string get_path () {-		return path;-	}--	public void scale_image_proportional_to_boundries (Glyph g) {-		double w, h;-		-		w = g.get_width ();-		h = g.get_height ();-						-		g.reset_zoom ();--		img_scale_y = h / get_img ().get_height ();-		-		img_offset_x = g.get_line ("left").pos;		-		img_offset_y = g.vertical_help_lines.first ().data.pos;--	}- 	public void reset_scale (Glyph g) { 		double w, h; @@ -444,7 +409,7 @@ class GlyphBackgroundImage {  	bool is_over_resize (double nx, double ny) { 		Glyph g = MainWindow.get_current_glyph ();-		double x, y, cx, cy, size;+		double x, y, size; 		bool inx, iny;  		size = 12 * g.view_zoom;diff --git a/src/GlyphCanvas.vala b/src/GlyphCanvas.valaindex f30cc19..ba89d9e 100644--- a/src/GlyphCanvas.vala+++ b/src/GlyphCanvas.vala@@ -63,7 +63,6 @@ class GlyphCanvas : DrawingArea  { 					}
 					
 					Supplement.current_glyph.resized (alloc, allocation);
-					MainWindow.native_window.update_window_size ();
 				}
 				
 				alloc = allocation;
@@ -149,6 +148,8 @@ class GlyphCanvas : DrawingArea  { 		});
 
 		redraw ();
+
+		MainWindow.native_window.update_window_size ();
 	}
 	
 	public static Glyph get_current_glyph ()  {
diff --git a/src/GtkInterface.vala b/src/GtkInterface.valaindex e228807..4d8e03f 100644--- a/src/GtkInterface.vala+++ b/src/GtkInterface.vala@@ -190,8 +190,6 @@ public class GtkWindow : Gtk.Window, NativeWindow { 		int w, h; 		get_size (out w, out h); 		-		print ("window_width $w\n");-		 		Preferences.set ("window_width", @"$w"); 		Preferences.set ("window_height", @"$h"); 	}

Contact

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