From 79ee0655b13d191175b2fe9e062d6804461942f9 Mon Sep 17 00:00:00 2001 From: tim h Date: Sat, 17 Dec 2022 15:07:10 -0600 Subject: [PATCH] fixes resolution changing while scrolling through returned images if sync cursor size is enabled --- js/index.js | 5 ++++- js/ui/tool/dream.js | 11 ++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/js/index.js b/js/index.js index 5341df9..212561d 100644 --- a/js/index.js +++ b/js/index.js @@ -952,7 +952,10 @@ function informCursorSizeSlider() { } const _resolution_onwheel = (evn) => { - if (stableDiffusionData.sync_cursor_size) { + if ( + stableDiffusionData.sync_cursor_size && + !toolbar._current_tool.state.block_res_change + ) { toolbar._current_tool.state.ignorePrevious = true; //so hacky resSlider.value = stableDiffusionData.width - (128 * evn.deltaY) / Math.abs(evn.deltaY); diff --git a/js/ui/tool/dream.js b/js/ui/tool/dream.js index cf18215..0a5bdc0 100644 --- a/js/ui/tool/dream.js +++ b/js/ui/tool/dream.js @@ -532,16 +532,21 @@ const _generate = async (endpoint, request, bb, options = {}) => { (evn, state) => { const contains = bb.contains(evn.x, evn.y); - if (!contains && !state.dream_processed) + if (!contains && !state.dream_processed) { imageCollection.inputElement.style.cursor = "auto"; - if (!contains || state.dream_processed) marchingOptions.style = "#FFF"; - + toolbar._current_tool.state.block_res_change = false; + } + if (!contains || state.dream_processed) { + marchingOptions.style = "#FFF"; + toolbar._current_tool.state.block_res_change = false; + } if (!state.dream_processed && contains) { marchingOptions.style = "#F55"; imageCollection.inputElement.style.cursor = "pointer"; state.dream_processed = true; + toolbar._current_tool.state.block_res_change = true; } }, 0,