Skip to content

Commit ee6e5df

Browse files
authored
Fix node not growing with label (#84)
1 parent 8fa1a61 commit ee6e5df

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • frontend/webEditor/src/diagram/nodes

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)