mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-29 19:05:05 +08:00
set min brush size to 1
This commit is contained in:
parent
1b9dea7d90
commit
661322707f
@ -474,6 +474,7 @@ onUiLoaded(async() => {
|
||||
input.click();
|
||||
if (!withoutValue) {
|
||||
const maxValue = parseFloat(input.getAttribute("max")) || 100;
|
||||
const minValue = parseFloat(input.getAttribute("min")) || 1;
|
||||
// allow brush size up to 1/2 diagonal of the image, beyond gradio's arbitrary limit
|
||||
const canvasImg = gradioApp().querySelector(`${elemId} img`);
|
||||
if (canvasImg) {
|
||||
@ -481,6 +482,9 @@ onUiLoaded(async() => {
|
||||
if (maxDiameter > maxValue) {
|
||||
input.setAttribute("max", maxDiameter);
|
||||
}
|
||||
if (minValue > 1) {
|
||||
input.setAttribute("min", '1');
|
||||
}
|
||||
}
|
||||
const brush_factor = deltaY > 0 ? 1 - opts.canvas_hotkey_brush_factor : 1 + opts.canvas_hotkey_brush_factor;
|
||||
const currentRadius = parseFloat(input.value);
|
||||
|
Loading…
Reference in New Issue
Block a user