diff --git a/src/core/xfa/template.js b/src/core/xfa/template.js index 251af54df..c3f0f65cc 100644 --- a/src/core/xfa/template.js +++ b/src/core/xfa/template.js @@ -475,7 +475,7 @@ class Arc extends XFAObject { }, }; - if (this.startAngle === 0 && this.sweepAngle === 360) { + if (this.sweepAngle === 360) { arc = { name: "ellipse", attributes: { @@ -490,12 +490,12 @@ class Arc extends XFAObject { } else { const startAngle = (this.startAngle * Math.PI) / 180; const sweepAngle = (this.sweepAngle * Math.PI) / 180; - const largeArc = this.sweepAngle - this.startAngle > 180 ? 1 : 0; + const largeArc = this.sweepAngle > 180 ? 1 : 0; const [x1, y1, x2, y2] = [ 50 * (1 + Math.cos(startAngle)), 50 * (1 - Math.sin(startAngle)), - 50 * (1 + Math.cos(sweepAngle)), - 50 * (1 - Math.sin(sweepAngle)), + 50 * (1 + Math.cos(startAngle + sweepAngle)), + 50 * (1 - Math.sin(startAngle + sweepAngle)), ]; arc = { diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index 1e0488f11..889b2a104 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -489,3 +489,4 @@ !issue14267.pdf !PDFBOX-4352-0.pdf !REDHAT-1531897-0.pdf +!xfa_issue14315.pdf diff --git a/test/pdfs/xfa_issue14315.pdf b/test/pdfs/xfa_issue14315.pdf new file mode 100644 index 000000000..3dde6e3d2 Binary files /dev/null and b/test/pdfs/xfa_issue14315.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 1bd10bd55..de7967d98 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -1037,6 +1037,13 @@ "lastPage": 1, "type": "eq" }, + { "id": "xfa_issue14315", + "file": "pdfs/xfa_issue14315.pdf", + "md5": "e239710875f9dea72fd94c20672a29e1", + "rounds": 1, + "enableXfa": true, + "type": "eq" + }, { "id": "xfa_issue14071", "file": "pdfs/xfa_issue14071.pdf", "md5": "7ef09705091602668ce22086c83a90f3",