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
1a322ca6
Commit
1a322ca6
authored
Apr 02, 2023
by
pythongosssss
Browse files
Fix scaled position
parent
32fd39b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
web/extensions/core/contextMenuFilter.js
web/extensions/core/contextMenuFilter.js
+7
-3
No files found.
web/extensions/core/contextMenuFilter.js
View file @
1a322ca6
...
@@ -111,9 +111,13 @@ app.registerExtension({
...
@@ -111,9 +111,13 @@ app.registerExtension({
// Focus the filter box when opening
// Focus the filter box when opening
filter
.
focus
();
filter
.
focus
();
// If the top is off screen then shift the element
const
rect
=
this
.
root
.
getBoundingClientRect
();
if
(
parseInt
(
this
.
root
.
style
.
top
)
<
0
)
{
this
.
root
.
style
.
top
=
0
;
// If the top is off screen then shift the element with scaling applied
if
(
rect
.
top
<
0
)
{
const
scale
=
1
-
this
.
root
.
getBoundingClientRect
().
height
/
this
.
root
.
clientHeight
;
const
shift
=
(
this
.
root
.
clientHeight
*
scale
)
/
2
;
this
.
root
.
style
.
top
=
-
shift
+
"
px
"
;
}
}
});
});
}
}
...
...
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