From f358e76f5b169c339dc4ba33f9e21f2c5f6b98af Mon Sep 17 00:00:00 2001
From: Jonas Jenwald <jonas.jenwald@gmail.com>
Date: Tue, 15 Nov 2022 16:30:53 +0100
Subject: [PATCH] Move the `_isOffscreenCanvasSupported` property to the base
 `Annotation` class

Having just played around with adding FreeText-annotations and then trying to print, there were `FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.` messages printed in the console.
The reason for this is that `FreeTextAnnotation` inherits from `MarkupAnnotation`, however only `WidgetAnnotation` actually defines the `_isOffscreenCanvasSupported` property.
---
 src/core/annotation.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/annotation.js b/src/core/annotation.js
index d8c390d22..23fa29252 100644
--- a/src/core/annotation.js
+++ b/src/core/annotation.js
@@ -524,6 +524,7 @@ class Annotation {
       this.data.pageIndex = params.pageIndex;
     }
 
+    this._isOffscreenCanvasSupported = params.isOffscreenCanvasSupported;
     this._fallbackFontDict = null;
     this._needAppearances = false;
   }
@@ -1519,7 +1520,6 @@ class WidgetAnnotation extends Annotation {
     const data = this.data;
     this.ref = params.ref;
     this._needAppearances = params.needAppearances;
-    this._isOffscreenCanvasSupported = params.isOffscreenCanvasSupported;
 
     data.annotationType = AnnotationType.WIDGET;
     if (data.fieldName === undefined) {