aboutsummaryrefslogtreecommitdiff
path: root/javascript
diff options
context:
space:
mode:
authoryfszzx <yfszzx@gmail.com>2022-10-17 15:23:32 +0800
committeryfszzx <yfszzx@gmail.com>2022-10-17 15:23:32 +0800
commit2a3e7ed872dc9b8da27cccc7f78df092f4a2f578 (patch)
tree5a288fe646eb58d35f4079b734a6d3765a98fd3f /javascript
parent5b1394bead93e5485ced5de10f1c000eea4458c6 (diff)
parentcccc5a20fce4bde9a4299f8790366790735f1d05 (diff)
Merge branch 'master' of https://github.com/yfszzx/stable-diffusion-webui-plus
Diffstat (limited to 'javascript')
-rw-r--r--javascript/imageMaskFix.js6
-rw-r--r--javascript/imageviewer.js2
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})`)