Skip to content

Commit 85c26eb

Browse files
committed
add minWidth and minHeight properties to BaseRectNode; refactor setSize method in RectNode
1 parent d474c76 commit 85c26eb

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

apps/vps-web/src/app/custom-nodes/classes/base-rect-node-class.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ export class BaseRectNode {
118118
if (this.rectElement) {
119119
this.rectElement.style.width = `${width}px`;
120120
this.rectElement.style.height = `${height}px`;
121+
this.rectElement.style.minWidth = `${width}px`;
122+
this.rectElement.style.minHeight = `${height}px`;
121123
}
122124
};
123125
}

apps/vps-web/src/app/custom-nodes/classes/rect-node-class.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,4 @@ w-min h-min
7373
);
7474
}
7575
onResize: ((width: number, height: number) => void) | undefined = undefined;
76-
setSize = (width: number, height: number) => {
77-
if (this.rectElement) {
78-
this.rectElement.style.width = `${width}px`;
79-
this.rectElement.style.height = `${height}px`;
80-
}
81-
};
8276
}

apps/vps-web/src/app/custom-nodes/rect-node.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ export const getRectNode =
119119
rectNode.canvasAppInstance = nodeInstance.contextInstance;
120120
rectNode.onResize = (width: number, height: number) => {
121121
// TODO : fix this... when changing the height, the node content is not resized
122-
const newHeight =
123-
height > (node.height ?? 10) ? height : node.height ?? 10;
122+
const newHeight = height;
123+
//height > (node.height ?? 10) ? height : node.height ?? 10;
124124
console.log('RECT RESIZE via onResize', width, newHeight);
125125
node.width = width;
126126
node.height = newHeight;

0 commit comments

Comments
 (0)