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
69680fed
Commit
69680fed
authored
Sep 16, 2023
by
Dr.Lt.Data
Browse files
fix: thumbnail ratio fix for mixed ratio images
parent
43d4935a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
web/scripts/app.js
web/scripts/app.js
+11
-1
No files found.
web/scripts/app.js
View file @
69680fed
...
@@ -532,7 +532,17 @@ export class ComfyApp {
...
@@ -532,7 +532,17 @@ export class ComfyApp {
}
}
}
}
this
.
imageRects
.
push
([
x
,
y
,
cellWidth
,
cellHeight
]);
this
.
imageRects
.
push
([
x
,
y
,
cellWidth
,
cellHeight
]);
ctx
.
drawImage
(
img
,
x
,
y
,
cellWidth
,
cellHeight
);
let
wratio
=
cellWidth
/
img
.
width
;
let
hratio
=
cellHeight
/
img
.
height
;
var
ratio
=
Math
.
min
(
wratio
,
hratio
);
let
imgHeight
=
ratio
*
img
.
height
;
let
imgY
=
row
*
cellHeight
+
shiftY
+
(
cellHeight
-
imgHeight
)
/
2
;
let
imgWidth
=
ratio
*
img
.
width
;
let
imgX
=
col
*
cellWidth
+
shiftX
+
(
cellWidth
-
imgWidth
)
/
2
;
ctx
.
drawImage
(
img
,
imgX
,
imgY
,
imgWidth
,
imgHeight
);
ctx
.
filter
=
"
none
"
;
ctx
.
filter
=
"
none
"
;
}
}
...
...
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