1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Fix how curveTo2 (v operator) is translated to SVG

Based on the PDF spec, with `v` operator, current point should be used as the first control point of the curve.

Do not overwrite current point before an SVG curve is built, so it can b actually used as first control point.
This commit is contained in:
Branislav Hašto 2020-02-02 17:03:29 +01:00
parent 517ccb7a39
commit 393aed9978

View file

@ -1231,8 +1231,6 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
j += 6;
break;
case OPS.curveTo2:
x = args[j + 2];
y = args[j + 3];
d.push(
"C",
pf(x),
@ -1242,6 +1240,8 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
pf(args[j + 2]),
pf(args[j + 3])
);
x = args[j + 2];
y = args[j + 3];
j += 4;
break;
case OPS.curveTo3: