Skip to content

Commit

Permalink
fixes resolution changing while scrolling through returned images if …
Browse files Browse the repository at this point in the history
…sync cursor size is enabled
  • Loading branch information
zero01101 committed Dec 17, 2022
1 parent 56c2a67 commit 79ee065
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 8 additions & 3 deletions js/ui/tool/dream.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 79ee065

Please sign in to comment.