summaryrefslogtreecommitdiff
path: root/src/app/RackScrollWidget.cpp
diff options
context:
space:
mode:
authorAndrew Belt <andrewpbelt@gmail.com>2019-04-24 12:52:41 -0400
committerAndrew Belt <andrewpbelt@gmail.com>2019-04-24 12:52:41 -0400
commitfaa96068af06103bd4e3aae008292f57b7bf09a4 (patch)
treea90afdae5c541d7d8fac3aa23db3e3ee48ced00e /src/app/RackScrollWidget.cpp
parentb65913c74f670423ff632fcea3ab829c18df75f3 (diff)
Remove useless `e.consume(this)` from events that no longer need it. Fix bugs introduced by change of event system behavior.
Diffstat (limited to 'src/app/RackScrollWidget.cpp')
-rw-r--r--src/app/RackScrollWidget.cpp36
1 files changed, 17 insertions, 19 deletions
diff --git a/src/app/RackScrollWidget.cpp b/src/app/RackScrollWidget.cpp
index fa9949a8..cb630ff9 100644
--- a/src/app/RackScrollWidget.cpp
+++ b/src/app/RackScrollWidget.cpp
@@ -75,25 +75,23 @@ void RackScrollWidget::draw(const DrawArgs &args) {
}
void RackScrollWidget::onHover(const event::Hover &e) {
- if (!APP->event->selectedWidget) {
- // Scroll with arrow keys
- float arrowSpeed = 30.0;
- if ((APP->window->getMods() & WINDOW_MOD_MASK) == (WINDOW_MOD_CTRL |GLFW_MOD_SHIFT))
- arrowSpeed /= 16.0;
- else if ((APP->window->getMods() & WINDOW_MOD_MASK) == WINDOW_MOD_CTRL)
- arrowSpeed *= 4.0;
- else if ((APP->window->getMods() & WINDOW_MOD_MASK) == GLFW_MOD_SHIFT)
- arrowSpeed /= 4.0;
-
- if (glfwGetKey(APP->window->win, GLFW_KEY_LEFT) == GLFW_PRESS)
- offset.x -= arrowSpeed;
- if (glfwGetKey(APP->window->win, GLFW_KEY_RIGHT) == GLFW_PRESS)
- offset.x += arrowSpeed;
- if (glfwGetKey(APP->window->win, GLFW_KEY_UP) == GLFW_PRESS)
- offset.y -= arrowSpeed;
- if (glfwGetKey(APP->window->win, GLFW_KEY_DOWN) == GLFW_PRESS)
- offset.y += arrowSpeed;
- }
+ // Scroll with arrow keys
+ float arrowSpeed = 30.0;
+ if ((APP->window->getMods() & WINDOW_MOD_MASK) == (WINDOW_MOD_CTRL |GLFW_MOD_SHIFT))
+ arrowSpeed /= 16.0;
+ else if ((APP->window->getMods() & WINDOW_MOD_MASK) == WINDOW_MOD_CTRL)
+ arrowSpeed *= 4.0;
+ else if ((APP->window->getMods() & WINDOW_MOD_MASK) == GLFW_MOD_SHIFT)
+ arrowSpeed /= 4.0;
+
+ if (glfwGetKey(APP->window->win, GLFW_KEY_LEFT) == GLFW_PRESS)
+ offset.x -= arrowSpeed;
+ if (glfwGetKey(APP->window->win, GLFW_KEY_RIGHT) == GLFW_PRESS)
+ offset.x += arrowSpeed;
+ if (glfwGetKey(APP->window->win, GLFW_KEY_UP) == GLFW_PRESS)
+ offset.y -= arrowSpeed;
+ if (glfwGetKey(APP->window->win, GLFW_KEY_DOWN) == GLFW_PRESS)
+ offset.y += arrowSpeed;
ScrollWidget::onHover(e);
}