Clone in a terminal:
Commit 4df49f4
Johan Mattsson - 2013-07-02T10:57:56+00:00
4df49f4e98d36d61e7e1d92bede044039f777056johan.mattsson.m@gmail.com

grid, comments & copyright

Changed files (14)

Diff

diff --git a/libbirdfont/DefaultCharactersSet.vala b/libbirdfont/DefaultCharactersSet.valaindex f17b5a4..77208e4 100644--- a/libbirdfont/DefaultCharactersSet.vala+++ b/libbirdfont/DefaultCharactersSet.vala@@ -39,8 +39,8 @@ public class DefaultCharacterSet { 	/** Add a new language to the menu for default character set. 	 * @param language A localized string of the language. 	 * @param language_code ISO code-	 * @param characters all characters (including characters with diacritical marks)-	 * for the language. For languages with too many glyphs should this string be left empty. +	 * @param characters all characters (including characters with diacritical marks).+	 * For languages with too many glyphs should this string be left empty.  	 * See the functions for chinese and japanese. 	 */ 	public static void add_language (string language, string language_code, string characters) {diff --git a/libbirdfont/EditPointHandle.vala b/libbirdfont/EditPointHandle.valaindex 157df1e..8948201 100644--- a/libbirdfont/EditPointHandle.vala+++ b/libbirdfont/EditPointHandle.vala@@ -149,7 +149,6 @@ public class EditPointHandle  { 	public void move_delta (double dx, double dy) { 		double px = px () + dx * Glyph.ivz (); 		double py = py () - dy * Glyph.ivz ();-		 		move_to_coordinate (px, py); 	} 	diff --git a/libbirdfont/Glyph.vala b/libbirdfont/Glyph.valaindex fa810ae..2d0e26f 100644--- a/libbirdfont/Glyph.vala+++ b/libbirdfont/Glyph.vala@@ -754,6 +754,12 @@ public class Glyph : FontDisplay { 		return (int) Math.rint ((x - g.view_offset_x + xc ()) * g.view_zoom); 	} +	public static double precise_reverse_path_coordinate_x (double x) {+		Glyph g = MainWindow.get_current_glyph ();+		return_val_if_fail (g.view_zoom != 0, 0);+		return (x - g.view_offset_x + xc ()) * g.view_zoom;+	}+	 	public static double path_coordinate_y (double y) { 		Glyph g = MainWindow.get_current_glyph (); 		return yc () - y * ivz () - g.view_offset_y;@@ -765,6 +771,12 @@ public class Glyph : FontDisplay { 		return (int) (-y); 	} +	public static double precise_reverse_path_coordinate_y (double y) {+		Glyph g = MainWindow.get_current_glyph ();+		y = (y + g.view_offset_y - yc ()) * g.view_zoom;	+		return -y;+	}+	 	public bool select_path (double x, double y) { 		Path? p = null; 		bool found = false;diff --git a/libbirdfont/PenTool.vala b/libbirdfont/PenTool.valaindex 3f70191..8e81a42 100644--- a/libbirdfont/PenTool.vala+++ b/libbirdfont/PenTool.vala@@ -37,9 +37,6 @@ public class PenTool : Tool { 	 	public static EditPoint? active_edit_point = new EditPoint (); -	/** Move handle vertical or horizontal. */-	public static bool tie_x_or_y_coordinates = false;- 	private static bool move_selected_handle = false;  	private static double last_point_x = 0;@@ -159,6 +156,8 @@ public class PenTool : Tool { 	public void move (double x, double y) { 		Glyph glyph = MainWindow.get_current_glyph (); 		double coordinate_x, coordinate_y;+		double px = 0;+		double py = 0; 		 		control_point_event (x, y); 		curve_active_corner_event (x, y);@@ -169,7 +168,7 @@ public class PenTool : Tool { 			move_current_point_on_path (x, y); 		} 		-		// move curve handles+		// move control point handles 		if (move_selected_handle) { 			if (selected_handle.type == PointType.LINE_CUBIC) { 				selected_handle.set_point_type (PointType.CUBIC);@@ -187,7 +186,9 @@ public class PenTool : Tool { 				coordinate_x = Glyph.path_coordinate_x (x); 				coordinate_y = Glyph.path_coordinate_y (y); 				GridTool.tie_coordinate (ref coordinate_x, ref coordinate_y);-				selected_handle.move_to_coordinate (coordinate_x, coordinate_y);+				px = Glyph.reverse_path_coordinate_x (coordinate_x);+				py = Glyph.reverse_path_coordinate_y (coordinate_y);+				selected_handle.move_delta ((px - last_point_x), (py - last_point_y)); 			} else { 				selected_handle.move_delta ((x - last_point_x) * precision, (y - last_point_y) * precision); 			}@@ -196,9 +197,14 @@ public class PenTool : Tool { 			 			// Fixa: redraw line only 			glyph.redraw_area (0, 0, glyph.allocation.width, glyph.allocation.height);-						-			last_point_x = x;-			last_point_y = y;+			+			if (GridTool.is_visible ()) {+				last_point_x = Glyph.precise_reverse_path_coordinate_x (selected_handle.x ());+				last_point_y = Glyph.precise_reverse_path_coordinate_y (selected_handle.y ());+			} else {+				last_point_x = x;+				last_point_y = y;				+			} 			 			return; 		}@@ -210,21 +216,24 @@ public class PenTool : Tool { 					coordinate_x = Glyph.path_coordinate_x (x); 					coordinate_y = Glyph.path_coordinate_y (y); 					GridTool.tie_coordinate (ref coordinate_x, ref coordinate_y);-					glyph.move_selected_edit_point_coordinates (p, coordinate_x, coordinate_y);+					px = Glyph.precise_reverse_path_coordinate_x (coordinate_x);+					py = Glyph.precise_reverse_path_coordinate_y (coordinate_y);+					glyph.move_selected_edit_point_delta (p, (px - last_point_x), (py - last_point_y)); 				} else { 					glyph.move_selected_edit_point_delta (p, (x - last_point_x) * precision, (y - last_point_y) * precision); 				} 				-				if (tie_x_or_y_coordinates) {-					GridTool.tie_to_prev (p, x, y);-				}-				 				p.recalculate_linear_handles (); 			} 		} 		-		last_point_x = x;-		last_point_y = y;+		if (GridTool.is_visible ()) {+			last_point_x = px;+			last_point_y = py;+		} else {+			last_point_x = x;+			last_point_y = y;			+		} 		 	} 	diff --git a/scripts/bavala.py b/scripts/bavala.pyindex ca053a6..ac263c5 100644--- a/scripts/bavala.py+++ b/scripts/bavala.py@@ -43,6 +43,7 @@ def cmd(name, *args):   def get_sources_path (folder, pattern):+    """obtain the path to all source files that matches pattern"""     files = []     for root, dirnames, filenames in os.walk(folder):         for filename in fnmatch.filter(filenames, pattern):@@ -52,6 +53,7 @@ def get_sources_path (folder, pattern):   def get_sources_name (folder, pattern):+    """obtain name of all source files that matches pattern"""     files = []     for root, dirnames, filenames in os.walk(folder):         for filename in fnmatch.filter(filenames, pattern):diff --git a/scripts/configfile.py b/scripts/configfile.pyindex 9a9689e..0ae8732 100755--- a/scripts/configfile.py+++ b/scripts/configfile.py@@ -1,4 +1,20 @@ #!/usr/bin/python+"""+Copyright (C) 2012, 2013 Eduardo Naufel Schettino and 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/>.+""" import version import time; diff --git a/scripts/export.sh b/scripts/export.shindex 39fd819..f8dc8a9 100755--- a/scripts/export.sh+++ b/scripts/export.sh@@ -1,4 +1,18 @@ #!/bin/bash+# Copyright (C) 2012, 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/>.  rep="$(pwd)" diff --git a/scripts/macport_build.py b/scripts/macport_build.pyindex 2a57067..6bc40e9 100755--- a/scripts/macport_build.py+++ b/scripts/macport_build.py@@ -1,4 +1,20 @@ #!/usr/bin/python+"""+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/>.+"""  import os import shutildiff --git a/scripts/macport_configure.py b/scripts/macport_configure.pyindex 767957a..b056916 100755--- a/scripts/macport_configure.py+++ b/scripts/macport_configure.py@@ -1,4 +1,20 @@ #!/usr/bin/python+"""+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/>.+"""  import configfile from optparse import OptionParserdiff --git a/scripts/macport_install.py b/scripts/macport_install.pyindex 3bdd3d8..3ddef7d 100755--- a/scripts/macport_install.py+++ b/scripts/macport_install.py@@ -1,4 +1,21 @@ #!/usr/bin/python+"""+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/>.+"""+ import os import subprocess import glob@@ -53,4 +70,4 @@ for lang_dir in glob.glob('build/locale/*'): 	lc = lang_dir.replace ('build/locale/', "") 	install ('build/locale/' + lc + '/LC_MESSAGES/birdfont.mo', '/share/locale/' + lc + '/LC_MESSAGES' ); -run ("cp -R -p build/BirdFont.app " + options.app)\ No newline at end of file+run ("cp -R -p build/BirdFont.app " + options.app)diff --git a/scripts/run.py b/scripts/run.pyindex a3c9b89..ae59baa 100644--- a/scripts/run.py+++ b/scripts/run.py@@ -1,4 +1,21 @@ #!/usr/bin/python+"""+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/>.+"""+ import subprocess  def run(cmd):diff --git a/scripts/translations.py b/scripts/translations.pyindex 36df856..de1f9aa 100644--- a/scripts/translations.py+++ b/scripts/translations.py@@ -1,4 +1,21 @@ #!/usr/bin/python+"""+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/>.+"""+ import glob from run import run diff --git a/scripts/version.py b/scripts/version.pyindex 1eb60ea..045c999 100644--- a/scripts/version.py+++ b/scripts/version.py@@ -1,2 +1,19 @@ #!/usr/bin/python+"""+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/>.+"""+ VERSION = '0.20'diff --git a/scripts/win_build.py b/scripts/win_build.pyindex 5c6b2dd..87a6ff6 100755--- a/scripts/win_build.py+++ b/scripts/win_build.py@@ -1,4 +1,20 @@ #!/usr/bin/python+"""+Copyright (C) 2012 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/>.+"""  import os import shutil

Contact

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