Clone in a terminal:
Commit fa973f4
Johan Mattsson - 2013-03-12T03:17:42+00:00
fa973f407b30b810b8d366d113cf804c4ada3907johan.mattsson.m@gmail.com

separate files for zoom view and path list

Changed files (10)

Diff

diff --git a/libbirdfont/BackgroundTool.vala b/libbirdfont/BackgroundTool.valaindex 548300e..144a2a6 100644--- a/libbirdfont/BackgroundTool.vala+++ b/libbirdfont/BackgroundTool.vala@@ -34,7 +34,6 @@ class BackgroundTool : Tool { 	public static double bottom_limit; 		 	bool move_bg;-	bool resize_bg; // DEL 	 	public BackgroundTool (string name) { 		base (name, _("Move, resize and rotate background image"));@@ -91,7 +90,6 @@ class BackgroundTool : Tool { 			((!)bg).handler_release (x, y); 			 			move_bg = false;-			resize_bg = false; 		});  		move_action.connect((self, x, y) => {			@@ -118,7 +116,9 @@ class BackgroundTool : Tool { 		 		 		bg.handler_move (x, y); 	-		if (!(move_bg || resize_bg)) return;+		if (move_bg) {+			return;+		} 		 		dx = x - begin_x; 		dy = y - begin_y;diff --git a/libbirdfont/CharDatabase.vala b/libbirdfont/CharDatabase.valaindex d231b38..f2ce631 100644--- a/libbirdfont/CharDatabase.vala+++ b/libbirdfont/CharDatabase.vala@@ -52,6 +52,7 @@ class CharDatabase { 			case 'j': return true; 			case 'p': return true; 			case 'q': return true;+			case 'y': return true; 		} 		 		return false;		diff --git a/libbirdfont/ClipTool.vala b/libbirdfont/ClipTool.valaindex a54a6a8..da26a65 100644--- a/libbirdfont/ClipTool.vala+++ b/libbirdfont/ClipTool.vala@@ -26,7 +26,7 @@ public class ClipTool : Tool { 		string inkscape_svg; 		 		if (fd is OverView) {-			// TODO:+			// TODO: copy glyphs in overview 		}  		 		if (fd is Glyph) {	diff --git a/libbirdfont/EotWriter.vala b/libbirdfont/EotWriter.valaindex 839722d..43e4595 100644--- a/libbirdfont/EotWriter.vala+++ b/libbirdfont/EotWriter.vala@@ -95,17 +95,17 @@ class EotWriter : GLib.Object { 		fd.add (0); // italic set to regular 				 		fd.add_littleendian_u32 (400); // weight-		fd.add_littleendian_u16 (0); // 0 drm, designer must know that notified+		fd.add_littleendian_u16 (0); // 0 drm, designer must be notified 		fd.add_littleendian_u16 (0x504C); // magic number -		// FIXA:+		// FIXME: 		// unicode ranges  		fd.add_littleendian_u32 (0); 		fd.add_littleendian_u32 (0); 		fd.add_littleendian_u32 (0); 		fd.add_littleendian_u32 (0); 		-		// FIXA:+		// FIXME: 		// code page range 		fd.add_littleendian_u32 (0); 		fd.add_littleendian_u32 (0);diff --git a/libbirdfont/OpenFontFormat/GlyfTable.vala b/libbirdfont/OpenFontFormat/GlyfTable.valaindex ead99e9..da2bfd4 100644--- a/libbirdfont/OpenFontFormat/GlyfTable.vala+++ b/libbirdfont/OpenFontFormat/GlyfTable.vala@@ -207,7 +207,7 @@ class GlyfTable : Table { 		 		g.remove_empty_paths (); 		if (g.path_list.length () == 0) {-			// location_offsets == location_offset + 1 to tell parser that this glyf does not have a body+			// location_offsets will be equal to location_offset + 1 to tell parser that this glyf does not have a body 			return; 		} 		diff --git a/libbirdfont/Path.vala b/libbirdfont/Path.valaindex 371cee1..24eab80 100644--- a/libbirdfont/Path.vala+++ b/libbirdfont/Path.vala@@ -575,10 +575,7 @@ public class Path { 		} 	} -	/** Resize path relative to bottom left coordinates.-	 * @param cx xmin position during resize-	 * @param cy ymin position during resize-	 */+	/** Resize path relative to bottom left coordinates. */ 	public void resize (double ratio) {	 		foreach (var p in points) { 			p.x *= ratio;@@ -1006,6 +1003,10 @@ public class Path { 		 		quadratic_path = copy (); 		+		if (quadratic_path.points.length () < 2) {+			return quadratic_path;+		}+		 		// add hidden points 		quadratic_path.add_hidden_double_points (); @@ -1166,10 +1167,14 @@ public class Path { 			ep.get_right_handle ().set_point_type (PointType.LINE_QUADRATIC); 			ep.get_left_handle ().set_point_type (PointType.LINE_QUADRATIC); 			ep.recalculate_linear_handles ();-		} else if (right == PointType.LINE_CUBIC && left  == PointType.LINE_CUBIC) {+		} else if (right == PointType.LINE_CUBIC && left == PointType.LINE_CUBIC) { 			ep.get_right_handle ().set_point_type (PointType.LINE_CUBIC); 			ep.get_left_handle ().set_point_type (PointType.LINE_CUBIC); 			ep.recalculate_linear_handles ();+		} else if (right == PointType.LINE_DOUBLE_CURVE && left == PointType.LINE_DOUBLE_CURVE) {+			ep.get_right_handle ().set_point_type (PointType.LINE_DOUBLE_CURVE);+			ep.get_left_handle ().set_point_type (PointType.LINE_DOUBLE_CURVE);+			ep.recalculate_linear_handles (); 		} else if (right == PointType.DOUBLE_CURVE || left == PointType.DOUBLE_CURVE) { 			double_bezier_vector (position, start.x, start.get_right_handle ().x (), stop.get_left_handle ().x (), stop.x, out x0, out x1); 			double_bezier_vector (position, start.y, start.get_right_handle ().y (), stop.get_left_handle ().y (), stop.y, out y0, out y1);@@ -1177,9 +1182,6 @@ public class Path { 			ep.get_left_handle ().move_to_coordinate (x1, y1); 			ep.get_right_handle ().move_to_coordinate (x0, y0); -//			ep.get_left_handle ().length = length0;-//			ep.get_right_handle ().length = length1;- 			ep.get_left_handle ().set_point_type (PointType.DOUBLE_CURVE);	 			ep.get_right_handle ().set_point_type (PointType.DOUBLE_CURVE); 		} else if (right == PointType.QUADRATIC) { @@ -1965,17 +1967,4 @@ public class Path { 	} } -public class PathList : GLib.Object {-	public List<Path> paths = new List<Path> ();-	-	public PathList () {-	}-	-	public void clear () {-		while (paths.length () > 0) {-			paths.remove_link (paths.first ());-		}-	}-}- }diff --git a/libbirdfont/PathList.vala b/libbirdfont/PathList.valanew file mode 100644index 0000000..472a853--- /dev/null+++ b/libbirdfont/PathList.vala@@ -0,0 +1,33 @@+/*+    Copyright (C) 2013 Johan Mattsson++    This program is free software: you can redistribute it and/or modify+    it under the terms of the GNU General Public License as published by+    the Free Software Foundation, either version 3 of the License, or+    (at your option) any later version.++    This program is distributed in the hope that it will be useful,+    but WITHOUT ANY WARRANTY; without even the implied warranty of+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+    GNU General Public License for more details.++    You should have received a copy of the GNU General Public License+    along with this program.  If not, see <http://www.gnu.org/licenses/>.+*/++namespace BirdFont {++public class PathList : GLib.Object {+	public List<Path> paths = new List<Path> ();+	+	public PathList () {+	}+	+	public void clear () {+		while (paths.length () > 0) {+			paths.remove_link (paths.first ());+		}+	}+}++}diff --git a/libbirdfont/Tool.vala b/libbirdfont/Tool.valaindex 769dc54..ac51456 100644--- a/libbirdfont/Tool.vala+++ b/libbirdfont/Tool.vala@@ -303,7 +303,7 @@ public class Tool : GLib.Object { 		Tool.yield (); 	} 	-	/** Run pending events in main loop before continue. */+	/** Run pending events in main loop before continuing. */ 	public static void @yield () { 		int t = 0; 		var time = new TimeoutSource (500);diff --git a/libbirdfont/ZoomTool.vala b/libbirdfont/ZoomTool.valaindex 4f4cd1b..c74fa55 100644--- a/libbirdfont/ZoomTool.vala+++ b/libbirdfont/ZoomTool.vala@@ -137,19 +137,5 @@ class ZoomTool : Tool { 		MainWindow.get_glyph_canvas ().redraw (); 	} }--class ZoomView : GLib.Object {-	public double x;-	public double y;-	public double zoom;-	public Allocation allocation;-	-	public ZoomView (double x, double y, double zoom, Allocation allocation) {-		this.x = x;-		this.y = y;-		this.zoom = zoom;-		this.allocation = allocation;-	}-} 	 }diff --git a/libbirdfont/ZoomView.vala b/libbirdfont/ZoomView.valanew file mode 100644index 0000000..1939739--- /dev/null+++ b/libbirdfont/ZoomView.vala@@ -0,0 +1,34 @@+/*+    Copyright (C) 2012 Johan Mattsson++    This program is free software: you can redistribute it and/or modify+    it under the terms of the GNU General Public License as published by+    the Free Software Foundation, either version 3 of the License, or+    (at your option) any later version.++    This program is distributed in the hope that it will be useful,+    but WITHOUT ANY WARRANTY; without even the implied warranty of+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+    GNU General Public License for more details.++    You should have received a copy of the GNU General Public License+    along with this program.  If not, see <http://www.gnu.org/licenses/>.+*/++namespace BirdFont {++class ZoomView : GLib.Object {+	public double x;+	public double y;+	public double zoom;+	public Allocation allocation;+	+	public ZoomView (double x, double y, double zoom, Allocation allocation) {+		this.x = x;+		this.y = y;+		this.zoom = zoom;+		this.allocation = allocation;+	}+}++}

Contact

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