-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Don't disable path clipping on paths with codes. #20363
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
Conversation
Seems good. Do you know if there's any other uses of has_curves() that should likewise be fixed? |
It's also passed to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit concerned that that image changed. I assume that is because something used to be clipped an there is a pixel or two that changed at the edges?
would e.g. setting |
Unfortunately not, tuning it down to 0 still fails at about 0.588 RMS, and thresholds in between are still a bit off. |
I guess I could live with putting that tol here. |
When `PathClipper` is applied, it is disabled if `has_curves()` is true. However, that method simply checks if the Path has _codes_, not curves. This means Paths created with codes, but using only MOVETO/LINETO, are not clipped when they could be. Additionally, the description for `PathClipper` says that "Curve segments are not clipped, but are always included in their entirety.", meaning there is no need to turn it off when the Path contains curves, as they will at least be handled, if not fully clipped.
1918143
to
81aa223
Compare
Done, actually default simplify threshold is even lower RMS. |
PR Summary
When
PathClipper
is applied, it is disabled ifhas_curves()
is true. However, that method simply checks if the Path has codes, not curves. This means Paths created with codes, but using only MOVETO/LINETO, are not clipped when they could be.Additionally, the description for
PathClipper
says that "Curve segments are not clipped, but are always included in their entirety.", meaning there is no need to turn it off when the Path contains curves, as they will at least be handled, if not fully clipped.PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).