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

Ensure that the isUsingOwnCanvas-parameter is consistently included in operatorLists (PR 14247 follow-up)

Currently some `OPS.beginAnnotation` arguments will contain a `Number` value for the `isUsingOwnCanvas`-parameter, or in some cases an `undefined` value, which is inconsistent from an API perspective.
This commit is contained in:
Jonas Jenwald 2022-07-28 13:37:37 +02:00
parent b06d190451
commit 2fb083f3e2
2 changed files with 22 additions and 2 deletions

View file

@ -876,8 +876,9 @@ class Annotation {
) {
const data = this.data;
let appearance = this.appearance;
const isUsingOwnCanvas =
this.data.hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY;
const isUsingOwnCanvas = !!(
this.data.hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY
);
if (!appearance) {
if (!isUsingOwnCanvas) {
return new OperatorList();
@ -1679,6 +1680,7 @@ class WidgetAnnotation extends Annotation {
this.data.rect,
transform,
this.getRotationMatrix(annotationStorage),
/* isUsingOwnCanvas = */ false,
]);
const stream = new StringStream(content);