mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Attempts to fix #1297
This commit is contained in:
parent
d3a09f1284
commit
050d72478e
@ -11,17 +11,19 @@ const InpaintingCanvasPlaceholder = () => {
|
|||||||
const ref = useRef<HTMLDivElement>(null);
|
const ref = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
if (!ref.current || !imageToInpaint) return;
|
window.setTimeout(() => {
|
||||||
|
if (!ref.current || !imageToInpaint) return;
|
||||||
|
|
||||||
const width = ref.current.clientWidth;
|
const width = ref.current.clientWidth;
|
||||||
const height = ref.current.clientHeight;
|
const height = ref.current.clientHeight;
|
||||||
|
|
||||||
const scale = Math.min(
|
const scale = Math.min(
|
||||||
1,
|
1,
|
||||||
Math.min(width / imageToInpaint.width, height / imageToInpaint.height)
|
Math.min(width / imageToInpaint.width, height / imageToInpaint.height)
|
||||||
);
|
);
|
||||||
|
|
||||||
dispatch(setStageScale(scale));
|
dispatch(setStageScale(scale));
|
||||||
|
}, 0);
|
||||||
}, [dispatch, imageToInpaint, needsCache]);
|
}, [dispatch, imageToInpaint, needsCache]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user