diff --git a/js/index.js b/js/index.js index 82981b0..2aede1c 100644 --- a/js/index.js +++ b/js/index.js @@ -472,15 +472,16 @@ const resSlider = makeSlider( "Resolution", document.getElementById("resolution"), "resolution", - 64, + 128, 2048, - 64, + 128, 512, 2, (v) => { stableDiffusionData.width = stableDiffusionData.height = v; stableDiffusionData.firstphase_width = stableDiffusionData.firstphase_height = v / 2; + informSliders(); } ); makeSlider( @@ -990,9 +991,19 @@ function resetToDefaults() { } } +function informSliders() { + if (toolbar._current_tool && toolbar._current_tool.state.matchResolution) { + if (!toolbar._current_tool.state.ignorePrevious) { + toolbar._current_tool.state.setCursorSize(stableDiffusionData.width); + } + toolbar._current_tool.state.ignorePrevious = false; + } +} + const _resolution_onwheel = (evn) => { - if (toolbar._current_tool.state.matchResolution) { + if (toolbar._current_tool && toolbar._current_tool.state.matchResolution) { + toolbar._current_tool.state.ignorePrevious = true; //so hacky resSlider.value = - stableDiffusionData.width - (64 * evn.deltaY) / Math.abs(evn.deltaY); + stableDiffusionData.width - (128 * evn.deltaY) / Math.abs(evn.deltaY); } }; diff --git a/js/ui/tool/dream.js b/js/ui/tool/dream.js index db1c3e5..3c939a5 100644 --- a/js/ui/tool/dream.js +++ b/js/ui/tool/dream.js @@ -884,9 +884,9 @@ const _dream_onwheel = (evn, state) => { // // TODO: Someone that has a smooth scrolling mouse should verify if this works with them. - const v = state.cursorSize - 64 * (evn.delta / Math.abs(evn.delta)); + const v = state.cursorSize - 128 * (evn.delta / Math.abs(evn.delta)); - state.cursorSize = state.setCursorSize(v + snap(v, 0, 64)); + state.cursorSize = state.setCursorSize(v + snap(v, 0, 128)); state.mousemovecb(evn); } }; @@ -987,9 +987,9 @@ const dreamTool = () => "cursorSize", "Cursor Size", { - min: 64, + min: 128, max: 2048, - step: 64, + step: 128, textStep: 2, } ); @@ -1248,9 +1248,9 @@ const img2imgTool = () => "cursorSize", "Cursor Size", { - min: 64, + min: 128, max: 2048, - step: 64, + step: 128, textStep: 2, } );