diff options
author | fortypercnt <114840933+fortypercnt@users.noreply.github.com> | 2022-10-17 03:25:34 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-17 04:48:28 +0000 |
commit | a1d3cbf92cfde6b3e02a9c795412d01cdc268934 (patch) | |
tree | e432227b24ae6691f2824051954e6bf509998120 /javascript | |
parent | c8045c5ad4f99deb3a19add06e0457de1df62b05 (diff) | |
download | stable-diffusion-webui-gfx803-a1d3cbf92cfde6b3e02a9c795412d01cdc268934.tar.gz stable-diffusion-webui-gfx803-a1d3cbf92cfde6b3e02a9c795412d01cdc268934.tar.bz2 stable-diffusion-webui-gfx803-a1d3cbf92cfde6b3e02a9c795412d01cdc268934.zip |
Fix #2750
left / top alignment was necessary with gradio 3.4.1. In gradio 3.5 the parent div of the image mask is centered, so the left / top alignment put the mask in the wrong place as described in #2750 #2795 #2805. This fix was tested on Windows 10 / Chrome.
Diffstat (limited to 'javascript')
-rw-r--r-- | javascript/imageMaskFix.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/javascript/imageMaskFix.js b/javascript/imageMaskFix.js index 3d77bfe9..9fe7a603 100644 --- a/javascript/imageMaskFix.js +++ b/javascript/imageMaskFix.js @@ -31,8 +31,8 @@ function imageMaskResize() { wrapper.style.width = `${wW}px`; wrapper.style.height = `${wH}px`; - wrapper.style.left = `${(w-wW)/2}px`; - wrapper.style.top = `${(h-wH)/2}px`; + wrapper.style.left = `0px`; + wrapper.style.top = `0px`; canvases.forEach( c => { c.style.width = c.style.height = ''; @@ -42,4 +42,4 @@ function imageMaskResize() { }); } - onUiUpdate(() => imageMaskResize());
\ No newline at end of file + onUiUpdate(() => imageMaskResize()); |