fixes resolution changing while scrolling through returned images if sync cursor size is enabled

This commit is contained in:
tim h 2022-12-17 15:07:10 -06:00
parent 56c2a6740a
commit 79ee0655b1
2 changed files with 12 additions and 4 deletions

View file

@ -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);

View file

@ -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,