Skip to content

Commit

Permalink
[fix]node resize bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Of-qinhai committed Dec 12, 2024
1 parent c021d52 commit e3ad2ac
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion bizyair_frontend
Submodule bizyair_frontend updated 423 files
20 changes: 10 additions & 10 deletions js/bizyair_frontend.js

Large diffs are not rendered by default.

26 changes: 14 additions & 12 deletions js/subassembly/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ export const hideWidget = (node, widget_name) => {
if (!widget) {
return
}
widget.computeSize = () => [0, 0]
widget.height = 0
widget.type = "hidden"

widget.options = widget.options || {}
setTimeout(() => {
if (node.setSize) {
node.computeSize();
node.setSize(node.computeSize());
node.graph?.setDirtyCanvas(true, true);
}
}, 0);
}
const originalComputeSize = widget.computeSize;
const originalType = widget.type;

widget.computeSize = () => [0, -4];
widget.height = 0;
widget.type = "hidden";
widget.options = widget.options || {};

widget.show = () => {
widget.computeSize = originalComputeSize;
widget.type = originalType;
widget.height = undefined;
};
}

0 comments on commit e3ad2ac

Please sign in to comment.