Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions plugins/field-multilineinput/src/field_multilineinput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,19 +305,14 @@
// This can't happen, but TypeScript thinks it can and lint forbids `!.`.
if (!constants) throw Error('Constants not found');
const nodes = (this.textGroup as SVGElement).childNodes;
const fontSize = constants.FIELD_TEXT_FONTSIZE;

Check warning on line 308 in plugins/field-multilineinput/src/field_multilineinput.ts

View workflow job for this annotation

GitHub Actions / lint

'fontSize' is assigned a value but never used
const fontWeight = constants.FIELD_TEXT_FONTWEIGHT;

Check warning on line 309 in plugins/field-multilineinput/src/field_multilineinput.ts

View workflow job for this annotation

GitHub Actions / lint

'fontWeight' is assigned a value but never used
const fontFamily = constants.FIELD_TEXT_FONTFAMILY;

Check warning on line 310 in plugins/field-multilineinput/src/field_multilineinput.ts

View workflow job for this annotation

GitHub Actions / lint

'fontFamily' is assigned a value but never used
let totalWidth = 0;
let totalHeight = 0;
for (let i = 0; i < nodes.length; i++) {
const tspan = nodes[i] as SVGTextElement;
const textWidth = Blockly.utils.dom.getFastTextWidth(
tspan,
fontSize,
fontWeight,
fontFamily,
);
const textWidth = Blockly.utils.dom.getTextWidth(tspan);
if (textWidth > totalWidth) {
totalWidth = textWidth;
}
Expand Down Expand Up @@ -345,12 +340,7 @@
);
}
dummyTextElement.textContent = actualEditorLines[i];
const lineWidth = Blockly.utils.dom.getFastTextWidth(
dummyTextElement,
fontSize,
fontWeight,
fontFamily,
);
const lineWidth = Blockly.utils.dom.getTextWidth(dummyTextElement);
if (lineWidth > totalWidth) {
totalWidth = lineWidth;
}
Expand Down
Loading