Skip to content

Commit affcd6e

Browse files
authored
fix: Use getTextWidth instead of getFastTextWidth (#2632)
1 parent 9ac3c28 commit affcd6e

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

plugins/field-multilineinput/src/field_multilineinput.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,7 @@ export class FieldMultilineInput extends Blockly.FieldTextInput {
312312
let totalHeight = 0;
313313
for (let i = 0; i < nodes.length; i++) {
314314
const tspan = nodes[i] as SVGTextElement;
315-
const textWidth = Blockly.utils.dom.getFastTextWidth(
316-
tspan,
317-
fontSize,
318-
fontWeight,
319-
fontFamily,
320-
);
315+
const textWidth = Blockly.utils.dom.getTextWidth(tspan);
321316
if (textWidth > totalWidth) {
322317
totalWidth = textWidth;
323318
}
@@ -345,12 +340,7 @@ export class FieldMultilineInput extends Blockly.FieldTextInput {
345340
);
346341
}
347342
dummyTextElement.textContent = actualEditorLines[i];
348-
const lineWidth = Blockly.utils.dom.getFastTextWidth(
349-
dummyTextElement,
350-
fontSize,
351-
fontWeight,
352-
fontFamily,
353-
);
343+
const lineWidth = Blockly.utils.dom.getTextWidth(dummyTextElement);
354344
if (lineWidth > totalWidth) {
355345
totalWidth = lineWidth;
356346
}

0 commit comments

Comments
 (0)