mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-02-13 00:49:22 +01:00
Merge pull request #303 from madrang/resize-inpainting-disable
Resize in-painting disable
This commit is contained in:
commit
d93f3468d3
@ -269,6 +269,9 @@ async function healthCheck() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function resizeInpaintingEditor() {
|
function resizeInpaintingEditor() {
|
||||||
|
if (!maskSetting.checked) {
|
||||||
|
return
|
||||||
|
}
|
||||||
let widthValue = parseInt(widthField.value)
|
let widthValue = parseInt(widthField.value)
|
||||||
let heightValue = parseInt(heightField.value)
|
let heightValue = parseInt(heightField.value)
|
||||||
if (widthValue === heightValue) {
|
if (widthValue === heightValue) {
|
||||||
@ -281,6 +284,11 @@ function resizeInpaintingEditor() {
|
|||||||
widthValue = (widthValue / heightValue) * INPAINTING_EDITOR_SIZE
|
widthValue = (widthValue / heightValue) * INPAINTING_EDITOR_SIZE
|
||||||
heightValue = INPAINTING_EDITOR_SIZE
|
heightValue = INPAINTING_EDITOR_SIZE
|
||||||
}
|
}
|
||||||
|
if (inpaintingEditor.opts.aspectRatio === (widthValue / heightValue).toFixed(3)) {
|
||||||
|
// Same ratio, don't reset the canvas.
|
||||||
|
return
|
||||||
|
}
|
||||||
|
inpaintingEditor.opts.aspectRatio = (widthValue / heightValue).toFixed(3)
|
||||||
|
|
||||||
inpaintingEditorContainer.style.width = widthValue + 'px'
|
inpaintingEditorContainer.style.width = widthValue + 'px'
|
||||||
inpaintingEditorContainer.style.height = heightValue + 'px'
|
inpaintingEditorContainer.style.height = heightValue + 'px'
|
||||||
@ -1145,6 +1153,7 @@ initImageClearBtn.addEventListener('click', function() {
|
|||||||
|
|
||||||
maskSetting.addEventListener('click', function() {
|
maskSetting.addEventListener('click', function() {
|
||||||
inpaintingEditorContainer.style.display = (this.checked ? 'block' : 'none')
|
inpaintingEditorContainer.style.display = (this.checked ? 'block' : 'none')
|
||||||
|
resizeInpaintingEditor()
|
||||||
})
|
})
|
||||||
|
|
||||||
promptsFromFileBtn.addEventListener('click', function() {
|
promptsFromFileBtn.addEventListener('click', function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user