From 66bbc0e7ee03c0584dfa111ba08360b365d1ee66 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 9 Jun 2022 10:11:01 +0200 Subject: [PATCH] Call `WidgetAnnotation._getTextWidth` correctly from the `ChoiceWidgetAnnotation`-class (PR 14720 follow-up) In the "no fontSize available" code-path, in the `ChoiceWidgetAnnotation._getAppearance` method, we don't provide the necessary second argument when calling the `_getTextWidth`-method which will cause errors to be thrown. --- 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 542fdc5c5..615b049c0 100644 --- a/src/core/annotation.js +++ b/src/core/annotation.js @@ -2706,7 +2706,7 @@ class ChoiceWidgetAnnotation extends WidgetAnnotation { let lineWidth = -1; let value; for (const { displayValue } of this.data.options) { - const width = this._getTextWidth(displayValue); + const width = this._getTextWidth(displayValue, font); if (width > lineWidth) { lineWidth = width; value = displayValue;