mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-20 21:30:09 +08:00
Fix the startup zoom error
This commit is contained in:
parent
5e37bf66c1
commit
ca7ba7d394
@ -401,7 +401,7 @@ onUiLoaded(async() => {
|
|||||||
toggleOverlap("off");
|
toggleOverlap("off");
|
||||||
fullScreenMode = false;
|
fullScreenMode = false;
|
||||||
|
|
||||||
const closeBtn = targetElement.querySelector("button[aria-label='Remove Image']");
|
const closeBtn = targetElement.querySelector("button[aria-label='Clear canvas']");
|
||||||
if (closeBtn) {
|
if (closeBtn) {
|
||||||
closeBtn.addEventListener("click", resetZoom);
|
closeBtn.addEventListener("click", resetZoom);
|
||||||
}
|
}
|
||||||
@ -479,9 +479,10 @@ onUiLoaded(async() => {
|
|||||||
|
|
||||||
// Reset zoom when uploading a new image
|
// Reset zoom when uploading a new image
|
||||||
const fileInput = gradioApp().querySelector(
|
const fileInput = gradioApp().querySelector(
|
||||||
`${elemId} input[type="file"][accept="image/*"].svelte-116rqfv`
|
`${elemId} .upload-container input[type="file"][accept="image/*"]`
|
||||||
);
|
);
|
||||||
fileInput.addEventListener("click", resetZoom);
|
fileInput.addEventListener("click", resetZoom);
|
||||||
|
|
||||||
|
|
||||||
// Update the zoom level and pan position of the target element based on the values of the zoomLevel, panX and panY variables
|
// Update the zoom level and pan position of the target element based on the values of the zoomLevel, panX and panY variables
|
||||||
function updateZoom(newZoomLevel, mouseX, mouseY) {
|
function updateZoom(newZoomLevel, mouseX, mouseY) {
|
||||||
@ -604,6 +605,8 @@ onUiLoaded(async() => {
|
|||||||
`${elemId} canvas[key="interface"]`
|
`${elemId} canvas[key="interface"]`
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// print(canvas)
|
||||||
|
|
||||||
if (!canvas) return;
|
if (!canvas) return;
|
||||||
|
|
||||||
if (canvas.offsetWidth > 862 || isExtension) {
|
if (canvas.offsetWidth > 862 || isExtension) {
|
||||||
|
Loading…
Reference in New Issue
Block a user