-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make move_to less strict #303
Comments
#320 correctly addresses this and I was mistaken about the segments iterator which already has this behavior. There is an additional question of what While exploring this, I also noticed that |
This could be done for example by putting this check: if path.elements().is_empty() {
return Err(SvgParseError::UninitializedPath)
} inside condition: Line 104 in b604470
But I have here new variant for |
It would be a breaking change but I believe we already have a few of those in main so now is probably a good time to add another :) |
Currently after a
close_path
, the only valid path building operation on aBezPath
is amove_to
. This is stricter than most existing standards, including PDF and SVG. In most other worlds, you can continue usingline_to
and friends, and the implicit current point is the same as the start/end point of the previous subpath.This is a semver breaking change, and would be good to get in 0.10. In addition to being friendlier, it enables a more efficient encoding into Vello paths - you can get the effect by clearing the SUBPATH_END_BIT set by the previous
close_path
.The work involves removing a number of checks, changing the documentation, and updating tests to reflect the new behavior. The core of it is changing
is_open_subpath()
tests to!is_empty()
.We're not at this time proposing making the initial
move_to
optional. It's been proposed to make it default to (0, 0), but that has its own set of problems, not least of which is that translation of a path by pointwise translation of all control points breaks.The text was updated successfully, but these errors were encountered: