diff --git a/src/gui/cursor.cpp b/src/gui/cursor.cpp index a65df5c04..3d95bf0f8 100644 --- a/src/gui/cursor.cpp +++ b/src/gui/cursor.cpp @@ -169,6 +169,7 @@ void FurnaceGUI::finishSelection() { } selecting=false; selectingFull=false; + mobilePatSel=false; if (dragging) { if (dragSourceX==dragDestinationX && dragSourceY==dragDestinationY && dragSourceXFine==dragDestinationXFine) { diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 74be097aa..a2402e553 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -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 (ypatWindowPos.y+patWindowSize.y-2.0f*dpiScale) { addScroll(1); } + if (xpatWindowPos.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), diff --git a/src/gui/gui.h b/src/gui/gui.h index ea4765bb1..69b7812fc 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -2366,6 +2366,7 @@ class FurnaceGUI { bool selecting, selectingFull, dragging, curNibble, orderNibble, followOrders, followPattern, changeAllOrders, mobileUI; bool collapseWindow, demandScrollX, fancyPattern, firstFrame, tempoView, waveHex, waveSigned, waveGenVisible, lockLayout, editOptsVisible, latchNibble, nonLatchNibble; bool keepLoopAlive, keepGrooveAlive, orderScrollLocked, orderScrollTolerance, dragMobileMenu, dragMobileEditButton, wantGrooveListFocus; + bool mobilePatSel; unsigned char lastAssetType; FurnaceGUIWindows curWindow, nextWindow, curWindowLast; std::atomic curWindowThreadSafe; @@ -2517,7 +2518,7 @@ class FurnaceGUI { int bindSetTarget, bindSetTargetIdx, bindSetPrevValue; bool bindSetActive, bindSetPending; - float nextScroll, nextAddScroll, orderScroll, orderScrollSlideOrigin; + float nextScroll, nextAddScroll, nextAddScrollX, orderScroll, orderScrollSlideOrigin; ImVec2 orderScrollRealOrigin; ImVec2 dragMobileMenuOrigin; @@ -3084,6 +3085,7 @@ class FurnaceGUI { void enableSafeMode(); void updateScroll(int amount); void addScroll(int amount); + void addScrollX(int amount); void setFileName(String name); void runBackupThread(); void pushPartBlend(); diff --git a/src/gui/pattern.cpp b/src/gui/pattern.cpp index f73c6a443..308637008 100644 --- a/src/gui/pattern.cpp +++ b/src/gui/pattern.cpp @@ -154,6 +154,7 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int if (ImGui::IsItemActive() && CHECK_LONG_HOLD) { ImGui::InhibitInertialScroll(); NOTIFY_LONG_HOLD; + mobilePatSel=true; } ImGui::PopStyleColor(); // for each column @@ -210,6 +211,7 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int if (ImGui::IsItemActive() && CHECK_LONG_HOLD) { ImGui::InhibitInertialScroll(); NOTIFY_LONG_HOLD; + mobilePatSel=true; } ImGui::PopStyleColor(); @@ -253,6 +255,7 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int if (ImGui::IsItemActive() && CHECK_LONG_HOLD) { ImGui::InhibitInertialScroll(); NOTIFY_LONG_HOLD; + mobilePatSel=true; } ImGui::PopStyleColor(); } @@ -290,6 +293,7 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int if (ImGui::IsItemActive() && CHECK_LONG_HOLD) { ImGui::InhibitInertialScroll(); NOTIFY_LONG_HOLD; + mobilePatSel=true; } ImGui::PopStyleColor(); } @@ -342,6 +346,7 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int if (ImGui::IsItemActive() && CHECK_LONG_HOLD) { ImGui::InhibitInertialScroll(); NOTIFY_LONG_HOLD; + mobilePatSel=true; } // effect value @@ -371,6 +376,7 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int if (ImGui::IsItemActive() && CHECK_LONG_HOLD) { ImGui::InhibitInertialScroll(); NOTIFY_LONG_HOLD; + mobilePatSel=true; } ImGui::PopStyleColor(); } @@ -465,6 +471,7 @@ void FurnaceGUI::drawPattern() { ImGui::SetNextWindowScroll(ImVec2(-1.0f,nextScroll)); nextScroll=-1.0f; nextAddScroll=0.0f; + nextAddScrollX=0.0f; } ImDrawList* tdl=NULL; @@ -480,6 +487,10 @@ void FurnaceGUI::drawPattern() { nextScroll=-1.0f; nextAddScroll=0.0f; } + if (nextAddScrollX!=0.0f) { + ImGui::SetScrollX(ImGui::GetScrollX()+nextAddScrollX); + nextAddScrollX=0.0f; + } ImGui::TableSetupScrollFreeze(1,1); for (int i=0; i