Commit ed856b0
Fix stroked paths
Changed files (3)
Diff
@@ -1653,7 +1653,7 @@ public class Glyph : FontDisplay { } if (has_path) {- cr.set_fill_rule (FillRule.EVEN_ODD);+ cr.set_fill_rule (FillRule.WINDING); Theme.color (cr, "Objects"); cr.fill (); }@@ -1664,6 +1664,14 @@ public class Glyph : FontDisplay { if (object is PathObject) { PathObject object_path = (PathObject) object; Glyph g = MainWindow.get_current_glyph ();++ if (object_path.path.stroke > 0) {+ cr.set_line_width (CanvasSettings.stroke_width / g.view_zoom);+ PathObject.draw_path_list (object_path.path.get_stroke_fast (), cr);+ Theme.color (cr, "Objects");+ cr.fill ();+ }+ cr.set_line_width (CanvasSettings.stroke_width / g.view_zoom); object_path.path.draw_path (cr); object_path.path.draw_control_points (cr);@@ -781,10 +781,6 @@ public class Path : GLib.Object { return new_path; } - public bool is_over_coordinate (double x, double y) {- return is_over_coordinate_var (x, y);- }- public static double point_distance (EditPoint p1, EditPoint p2) { return distance (p1.x, p2.x, p1.y, p2.y); }@@ -839,10 +835,12 @@ public class Path : GLib.Object { } /** Variable precision */- public bool is_over_coordinate_var (double x, double y) {+ public bool is_over_coordinate (double x, double y) { int insides = 0; Path path; + print (@"is_over_coordinate_var stroke: $stroke\n");+ if (stroke > 0) { foreach (Path p in get_stroke_fast ().paths) { path = p.flatten ();@@ -867,11 +865,6 @@ public class Path : GLib.Object { } public bool is_over_boundry (double x, double y) {- if (unlikely (ymin == double.MAX || ymin == 10000)) {- warning ("bounding box is not calculated, run update_region_boundaries first.");- update_region_boundaries ();- }- return (ymin <= y <= ymax) && (xmin <= x <= xmax); } @@ -31,7 +31,6 @@ public class PathObject : SvgBird.Object { } } - // FIXME: flip y axis public override double xmin { get {@@ -106,7 +105,11 @@ public class PathObject : SvgBird.Object { } public void draw_path (Context cr) {- path.draw_path (cr);+ if (path.stroke > 0) {+ draw_path_list (path.get_completed_stroke (), cr);+ } else {+ path.draw_path (cr);+ } } public static void draw_path_list (PathList pl, Context cr) {