Skip to content

Commit ced7509

Browse files
committed
fix node not growing with label
1 parent d1ff0eb commit ced7509

File tree

1 file changed

+2
-1
lines changed
  • frontend/webEditor/src/diagram/nodes

1 file changed

+2
-1
lines changed

frontend/webEditor/src/diagram/nodes/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ export abstract class DfdNodeImpl extends SNodeImpl implements WithEditableLabel
4949
return this.minimumWidth + DfdNodeImpl.WIDTH_PADDING;
5050
}
5151
const textWidth = calculateTextSize(this.text).width;
52+
const editLabelWidth = this.editableLabel ? calculateTextSize(this.editableLabel.text).width : 0;
5253
const labelWidths = this.labels.map(
5354
(labelAssignment) => this.dfdNodeLabelRenderer?.computeLabelContent(labelAssignment)[1] ?? 0,
5455
);
5556

56-
const neededWidth = Math.max(...labelWidths, textWidth, DfdNodeImpl.DEFAULT_WIDTH);
57+
const neededWidth = Math.max(...labelWidths, textWidth, editLabelWidth, DfdNodeImpl.DEFAULT_WIDTH);
5758
return neededWidth + DfdNodeImpl.WIDTH_PADDING;
5859
}
5960

0 commit comments

Comments
 (0)