-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fixes / improvements for RegularShape #12467
Conversation
eca9582
to
d28c5c3
Compare
Great work @MoonE! Let me know if you want me to look into anything specifically, or if you need help finishing this pull request. |
d28c5c3
to
70def17
Compare
0808709
to
dbe284b
Compare
Setting the correct canvas size works, except with very pointy star, then it is still beveled. Maybe there is some hardcoded limit? |
664af5e
to
7847d39
Compare
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.
This looks excellent, @MoonE! Please check the failing rendering tests - if it's just pixel shifts caused by the fix, you can replace the reference images with those provided in the rendering test artifacts. Let me know if you need help with that. Also, please remove the test example. Then you can merge. Thanks!
With pixelRatio != 1 and a transparent fill a unnecessary image was created.
Fixes missing miter/bevel line join because path was not closed before stroking. Reduce canvas context calls, skip beginPath, and instead of drawing the last point use closePath
Always double the points event when two radii of same size are provided.
- remove jitter when using RegularShape size in animation, size should always be an integer - canvas may have been too small for miter line join - canvas was at least one stroke width too large for round line join - reduce canvas size even more for bevel line join Canvas now precisely fits the shape including stroke, The angle of the shape is ignored for the calculation.
Creating the cached canvases is expensive and they may never be used. E. g. the hit detect canvas is not needed with the Immediate renderer and if a feature is never in the viewport the image is not needed either.
7847d39
to
ad37baf
Compare
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.
That is not the latest image. This was for testing, but it is already removed when I remove the example |
Ah cool. While I'm at checking the rendering tests, I could add a commit with the updated reference images. Do you want me to do that, or are you already at it? |
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.
I just pushed that commit, @MoonE. Now rendering tests should pass. If they do, please merge.
Thanks you, @ahocevar |
Use getPixelRatio() as in ImageBuilder
Do not apply #12467 change to Icons
Fixes #12461