Closed
Description
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/#):
var doc = new jsPDF();
const canvas = doc.canvas;
const ctx = canvas.getContext('2d')
ctx.beginPath();
ctx.arc(80, 80, 65, 0, Math.PI);
ctx.closePath();
ctx.lineWidth = 6;
ctx.stroke();
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):
var doc = new jsPDF();
const canvas = doc.canvas;
const ctx = canvas.getContext('2d')
ctx.beginPath();
ctx.arc(
106,
130,
100,
-1.5707963267948966,
-0.3141592653589793,
false);
ctx.arc(
106,
130,
62.5,
-0.3141592653589793,
-1.5707963267948966,
true);
ctx.closePath();
ctx.stroke();
Here is the jsfiddle page for the expected behaviour: https://jsfiddle.net/p7vmqu6r/1/
Metadata
Metadata
Assignees
Labels
No labels