GUI: selection/scroll improvements

now you can scroll left/right by dragging selection to the side edges
This commit is contained in:
tildearrow 2025-02-22 18:43:46 -05:00
parent f59cb23d9b
commit dd9983778b
4 changed files with 29 additions and 2 deletions

View file

@ -569,6 +569,12 @@ void FurnaceGUI::addScroll(int amount) {
haveHitBounds=false;
}
void FurnaceGUI::addScrollX(int amount) {
float lineHeight=(patFont->FontSize+2*dpiScale);
nextAddScrollX=lineHeight*amount;
haveHitBounds=false;
}
void FurnaceGUI::setFileName(String name) {
#ifdef _WIN32
wchar_t ret[4096];
@ -3571,7 +3577,7 @@ void FurnaceGUI::pointUp(int x, int y, int button) {
}
void FurnaceGUI::pointMotion(int x, int y, int xrel, int yrel) {
if (selecting) {
if (selecting && (!mobileUI || mobilePatSel)) {
// detect whether we have to scroll
if (y<patWindowPos.y+2.0f*dpiScale) {
addScroll(-1);
@ -3579,6 +3585,12 @@ void FurnaceGUI::pointMotion(int x, int y, int xrel, int yrel) {
if (y>patWindowPos.y+patWindowSize.y-2.0f*dpiScale) {
addScroll(1);
}
if (x<patWindowPos.x+(mobileUI?40.0f:4.0f)*dpiScale) {
addScrollX(-1);
}
if (x>patWindowPos.x+patWindowSize.x-(mobileUI?40.0f:4.0f)*dpiScale) {
addScrollX(1);
}
}
if (macroDragActive || macroLoopDragActive || waveDragActive || sampleDragActive || orderScrollLocked) {
int distance=fabs((double)xrel);
@ -8546,6 +8558,7 @@ FurnaceGUI::FurnaceGUI():
dragMobileMenu(false),
dragMobileEditButton(false),
wantGrooveListFocus(false),
mobilePatSel(false),
lastAssetType(0),
curWindow(GUI_WINDOW_NOTHING),
nextWindow(GUI_WINDOW_NOTHING),