mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 14:48:08 +02:00
Merge pull request #14319 from calixteman/xfa_arc
XFA - Draw arcs correctly
This commit is contained in:
commit
bbd8b5ce9f
4 changed files with 12 additions and 4 deletions
|
@ -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 = {
|
||||
|
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -489,3 +489,4 @@
|
|||
!issue14267.pdf
|
||||
!PDFBOX-4352-0.pdf
|
||||
!REDHAT-1531897-0.pdf
|
||||
!xfa_issue14315.pdf
|
||||
|
|
BIN
test/pdfs/xfa_issue14315.pdf
Normal file
BIN
test/pdfs/xfa_issue14315.pdf
Normal file
Binary file not shown.
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue