GUI: scroll to cursor pos on click

This commit is contained in:
tildearrow 2021-12-23 22:20:54 -05:00
parent c41435353a
commit be4ad87a3a

View file

@ -2145,7 +2145,13 @@ bool FurnaceGUI::loop() {
macroDragActive=false; macroDragActive=false;
macroLoopDragActive=false; macroLoopDragActive=false;
waveDragActive=false; waveDragActive=false;
if (selecting) finishSelection(); if (selecting) {
finishSelection();
if (cursor.xCoarse==selStart.xCoarse && cursor.xFine==selStart.xFine && cursor.y==selStart.y &&
cursor.xCoarse==selEnd.xCoarse && cursor.xFine==selEnd.xFine && cursor.y==selEnd.y) {
updateScroll(cursor.y);
}
}
break; break;
case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONDOWN:
aboutOpen=false; aboutOpen=false;