Commit 246fd0d
last point is first
Changed files (4)
modifiedlibbirdfont/ImportSvg.valamodifiedlibbirdfont/OverView.valamodifiedlibbirdfont/Svg.valamodifiedlibbirdfont/TestCases.vala
Diff
@@ -773,10 +773,12 @@ public class ImportSvg { ep1 = path.points.last ().data; ep2 = path.points.first ().data; - path.points.remove_link (path.points.last ());- ep2.left_handle.angle = ep1.left_handle.angle;- ep2.left_handle.length = ep1.left_handle.length;- ep2.left_handle.type = ep1.left_handle.type;+ if (ep1.x == ep2.x && ep1.y == ep2.y) {+ path.points.remove_link (path.points.last ());+ ep2.left_handle.angle = ep1.left_handle.angle;+ ep2.left_handle.length = ep1.left_handle.length;+ ep2.left_handle.type = ep1.left_handle.type;+ } glyph.add_path (path); path.close ();@@ -869,8 +869,6 @@ public class OverView : FontDisplay { double x = view_offset_x; double y = view_offset_y; - unichar current = selected;- // click in margin int n_items = (allocation.width - 40 / nail_width); double m = (allocation.width - 40 - (n_items * nail_width)) / 2.0;@@ -87,10 +87,6 @@ class Svg { } else if (end.get_left_handle ().type == PointType.CURVE) { add_cubic_abs_path (end, start, svg, g, do_glyph); }-- if (end.get_left_handle ().type == PointType.NONE) {- warning ("No point type.");- } } private static void add_abs_start (EditPoint ep, StringBuilder svg, Glyph g, bool to_glyph) { @@ -54,6 +54,10 @@ class TestCases { g = MainWindow.get_current_glyph (); ImportSvg.parse_svg_data ("M20,300 Q400,50 600,300 T1000,300Q1200 50 1400 300Q1600 50 1800 600 L 1800 700 L 200 700 z", g); Toolbox.select_tool_by_name ("full_glyph");+ + g = MainWindow.get_current_glyph ();+ ImportSvg.parse_svg_data ("M300 400 h-200 l0 1000 h200z", g, true);+ Toolbox.select_tool_by_name ("full_glyph"); } public static void test_illustrator_import () {