Clone in a terminal:
Commit 05e8b3a
Johan Mattsson - 2013-07-05T12:21:25+00:00
05e8b3aa6e1c1ecd62f76738fa86e0a586bf9c92johan.mattsson.m@gmail.com

Merge branch 'master' of gitorious.org:birdfont/birdfont

Changed files (1)

Diff

diff --git a/libbirdfont/ImportSvg.vala b/libbirdfont/ImportSvg.valaindex b4192b4..f262299 100644--- a/libbirdfont/ImportSvg.vala+++ b/libbirdfont/ImportSvg.vala@@ -15,6 +15,7 @@     along with this program.  If not, see <http://www.gnu.org/licenses/>. */ using Xml;+using Math;  namespace BirdFont { 	@@ -417,10 +418,7 @@ public class ImportSvg { 					} else { 						cy = -parse_double (c[++i]); 					}--					px2 = cx;-					py2 = cy;-										+									 					p[pi++] = cx; 					p[pi++] = cy; 					@@ -432,6 +430,9 @@ public class ImportSvg { 						cy = -parse_double (c[++i]); 					} 					+					px2 = cx;+					py2 = cy;+					 					p[pi++] = cx; 					p[pi++] = cy; 					@@ -624,9 +625,9 @@ public class ImportSvg { 				while (is_point (c[i + 1])) { 					command[ci++] = "C"; 					-					// the reflection again+					// the reflection 					cx = 2 * px - px2;-					cy = 2 * py - py2; // if (svg_glyph) ?+					cy = 2 * py - py2; // if (svg_glyph) ?			 					p[pi++] = cx; 					p[pi++] = cy; @@ -807,6 +808,7 @@ public class ImportSvg { 					path.points.remove_link (path.points.last ()); 				} +				set_tied_handles (path); 				glyph.add_path (path); 				glyph.close_path (); 								@@ -839,6 +841,22 @@ public class ImportSvg { 		 		return double.try_parse ((!) s); 	}+	+	static void set_tied_handles (Path path) {+		double a, b;+		double da, db;+		foreach (EditPoint p in path.points) {+			a = p.get_left_handle ().angle;+			b = p.get_left_handle ().angle;+			+			da = a - b;+			db = a - b;+			+			if (da < 0.0001 || db  < 0.0001) {+				p.set_tie_handle (true);+			}+		}+	} }  }

Contact

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