-
Notifications
You must be signed in to change notification settings - Fork 4.7k
context2D closePath on arc closes path to centre x point and not to drawn line start #3293
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
Comments
Hello! |
The main problem, is that the closePath function tries to connect to the x, y coordinates of the first drawn object, but the arc method stores the origin as x and y. |
Thanks for the bug report and the PR. Could it be that the fill issue is also related to the "fake closing"? |
I don't really know the pdf syntax. But I think this two issue are related. |
I have read and understood the contribution guidelines.
Version: ^2.4.0
The
closePath()
the context2D seems to be closing on the centre x point of the arc rather than the actual drawn arc line.Simple example (This can be copied and pasted into the playground https://raw.githack.com/MrRio/jsPDF/master/#):
Which is grabbed from this page: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/closePath#closing_just_one_sub-path (You can see the correct behaviour here)

Slightly more complex example (can also be copied into the playground):
Here is the jsfiddle page for the expected behaviour: https://jsfiddle.net/p7vmqu6r/1/
The text was updated successfully, but these errors were encountered: