Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
8c3d2443
Commit
8c3d2443
authored
Jun 20, 2023
by
ssit
Browse files
Fix overlapping when converting widgets to inputs
parent
186f9204
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
web/extensions/core/widgetInputs.js
web/extensions/core/widgetInputs.js
+8
-0
No files found.
web/extensions/core/widgetInputs.js
View file @
8c3d2443
...
@@ -59,6 +59,10 @@ function convertToInput(node, widget, config) {
...
@@ -59,6 +59,10 @@ function convertToInput(node, widget, config) {
widget
:
{
name
:
widget
.
name
,
config
},
widget
:
{
name
:
widget
.
name
,
config
},
});
});
for
(
const
widget
of
node
.
widgets
)
{
widget
.
last_y
+=
LiteGraph
.
NODE_SLOT_HEIGHT
;
}
// Restore original size but grow if needed
// Restore original size but grow if needed
node
.
setSize
([
Math
.
max
(
sz
[
0
],
node
.
size
[
0
]),
Math
.
max
(
sz
[
1
],
node
.
size
[
1
])]);
node
.
setSize
([
Math
.
max
(
sz
[
0
],
node
.
size
[
0
]),
Math
.
max
(
sz
[
1
],
node
.
size
[
1
])]);
}
}
...
@@ -68,6 +72,10 @@ function convertToWidget(node, widget) {
...
@@ -68,6 +72,10 @@ function convertToWidget(node, widget) {
const
sz
=
node
.
size
;
const
sz
=
node
.
size
;
node
.
removeInput
(
node
.
inputs
.
findIndex
((
i
)
=>
i
.
widget
?.
name
===
widget
.
name
));
node
.
removeInput
(
node
.
inputs
.
findIndex
((
i
)
=>
i
.
widget
?.
name
===
widget
.
name
));
for
(
const
widget
of
node
.
widgets
)
{
widget
.
last_y
-=
LiteGraph
.
NODE_SLOT_HEIGHT
;
}
// Restore original size but grow if needed
// Restore original size but grow if needed
node
.
setSize
([
Math
.
max
(
sz
[
0
],
node
.
size
[
0
]),
Math
.
max
(
sz
[
1
],
node
.
size
[
1
])]);
node
.
setSize
([
Math
.
max
(
sz
[
0
],
node
.
size
[
0
]),
Math
.
max
(
sz
[
1
],
node
.
size
[
1
])]);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment