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.
This commit is contained in:
Jonas Jenwald 2022-06-09 10:11:01 +02:00
parent b5cad9be03
commit 66bbc0e7ee

View File

@ -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;