Browse Source

implement horizontal scroll lock (hold shift key)

pull/1639/head
bsp2 6 years ago
parent
commit
24360e9d0e
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      src/ui/ScrollWidget.cpp

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

@@ -140,7 +140,12 @@ void ScrollWidget::onMouseMove(EventMouseMove &e) {
}

void ScrollWidget::onScroll(EventScroll &e) {
offset = offset.minus(e.scrollRel);
if(windowIsShiftPressed()) {
offset.x -= e.scrollRel.x;
}
else {
offset = offset.minus(e.scrollRel);
}
e.consumed = true;
}



Loading…
Cancel
Save