improved node width

This commit is contained in:
BroodjeAap 2022-10-03 20:36:28 +00:00
parent b4967ca9b0
commit 569f9b62a8
2 changed files with 2 additions and 2 deletions

View file

@ -376,7 +376,7 @@ var DiagramNode = /** @class */ (function (_super) {
var typeSize = ctx.measureText(this.type);
this.typeWidth = typeSize.width;
this.typeHeight = typeSize.actualBoundingBoxAscent + typeSize.actualBoundingBoxDescent;
this.width = Math.max(150, this.labelWidth, this.typeWidth);
this.width = Math.max(130, this.labelWidth * 1.5, this.typeWidth * 1.2);
};
DiagramNode.prototype.pointInObject = function (p) {
return this.pointNearNode(p) && (_super.prototype.pointInObject.call(this, p) || this.input.pointInObject(p) || this.output.pointInObject(p));

View file

@ -451,7 +451,7 @@ class DiagramNode extends CanvasObject {
this.typeWidth = typeSize.width;
this.typeHeight = typeSize.actualBoundingBoxAscent + typeSize.actualBoundingBoxDescent;
this.width = Math.max(150, this.labelWidth, this.typeWidth);
this.width = Math.max(130, this.labelWidth * 1.5, this.typeWidth * 1.2);
}
pointInObject(p: Point): boolean {