Browse Source

Fix Ctrl+scroll zooming with RackScrollWidget, which was broken when knob scrolling was added.

tags/v2.0.0
Andrew Belt 4 years ago
parent
commit
096f40f4f6
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      src/ui/ScrollWidget.cpp

+ 6
- 1
src/ui/ScrollWidget.cpp View File

@@ -129,6 +129,11 @@ void ScrollWidget::onHoverScroll(const event::HoverScroll& e) {
if (e.isConsumed())
return;

int mods = APP->window->getMods();
// Don't scroll when Ctrl is held because this interferes with RackScrollWidget zooming.
if ((mods & RACK_MOD_MASK) & RACK_MOD_CTRL)
return;

// Check if scrollable
math::Rect offsetBound = getContainerOffsetBound();
if (offsetBound.size.x <= 0.f && offsetBound.size.y <= 0.f)
@@ -138,7 +143,7 @@ void ScrollWidget::onHoverScroll(const event::HoverScroll& e) {
// Flip coordinates if shift is held
// Mac (or GLFW?) already does this for us.
#if !defined ARCH_MAC
if ((APP->window->getMods() & RACK_MOD_MASK) == GLFW_MOD_SHIFT)
if ((mods & RACK_MOD_MASK) == GLFW_MOD_SHIFT)
scrollDelta = scrollDelta.flip();
#endif



Loading…
Cancel
Save