diff options
author | yfszzx <yfszzx@gmail.com> | 2022-10-17 07:23:32 +0000 |
---|---|---|
committer | yfszzx <yfszzx@gmail.com> | 2022-10-17 07:23:32 +0000 |
commit | 2a3e7ed872dc9b8da27cccc7f78df092f4a2f578 (patch) | |
tree | 5a288fe646eb58d35f4079b734a6d3765a98fd3f /javascript | |
parent | 5b1394bead93e5485ced5de10f1c000eea4458c6 (diff) | |
parent | cccc5a20fce4bde9a4299f8790366790735f1d05 (diff) | |
download | stable-diffusion-webui-gfx803-2a3e7ed872dc9b8da27cccc7f78df092f4a2f578.tar.gz stable-diffusion-webui-gfx803-2a3e7ed872dc9b8da27cccc7f78df092f4a2f578.tar.bz2 stable-diffusion-webui-gfx803-2a3e7ed872dc9b8da27cccc7f78df092f4a2f578.zip |
Merge branch 'master' of https://github.com/yfszzx/stable-diffusion-webui-plus
Diffstat (limited to 'javascript')
-rw-r--r-- | javascript/imageMaskFix.js | 6 | ||||
-rw-r--r-- | javascript/imageviewer.js | 2 |
2 files changed, 4 insertions, 4 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()); diff --git a/javascript/imageviewer.js b/javascript/imageviewer.js index 65a33dd7..d4ab6984 100644 --- a/javascript/imageviewer.js +++ b/javascript/imageviewer.js @@ -31,7 +31,7 @@ function updateOnBackgroundChange() { } }) - if (modalImage.src != currentButton.children[0].src) { + if (currentButton?.children?.length > 0 && modalImage.src != currentButton.children[0].src) { modalImage.src = currentButton.children[0].src; if (modalImage.style.display === 'none') { modal.style.setProperty('background-image', `url(${modalImage.src})`) |