-
Notifications
You must be signed in to change notification settings - Fork 86
Closed
Description
When calling BezPath::from_path_segments
on a path made up of polylines, the returned path sometimes has spurious MoveTo
s in the middle. This is bad because it messes with the closedness of the path. See (GraphiteEditor/Graphite#2670 (comment)) for an example of the fallout.
Here's an example where a rect becomes a path of the form moveto
, lineto
, lineto
, lineto
, moveto
, lineto
.
fn test_rect_segments() {
let x0 = 25.189500810000002;
let x1 = 568.18950081;
let y0 = -105.0;
let y1 = 176.0;
let r = Rect::from_points((x0, y0), (x1, y1));
// a rect should become a path with 5 elements: a MoveTo and 4 LineTos
assert_eq!(
BezPath::from_path_segments(r.into_path(0.0).segments())
.elements()
.len(),
5
);
}
Metadata
Metadata
Assignees
Labels
No labels