diff options
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 50a0a6a28..c4c69afa1 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -1170,12 +1170,12 @@ void Gui::handleMouseWheelMovedDown(const MouseInput& mouseInput) if (mFocusHandler->getDraggedWidget()) sourceWidget = mFocusHandler->getDraggedWidget(); - int sourceWidgetX = 0; - int sourceWidgetY = 0; if (sourceWidget) { - sourceWidget->getAbsolutePosition(sourceWidgetX, sourceWidgetY); + int sourceWidgetX = 0; + int sourceWidgetY = 0; + sourceWidget->getAbsolutePosition(sourceWidgetX, sourceWidgetY); distributeMouseEvent(sourceWidget, MouseEventType::WHEEL_MOVED_DOWN, mouseInput.getButton(), @@ -1192,10 +1192,11 @@ void Gui::handleMouseWheelMovedUp(const MouseInput& mouseInput) if (mFocusHandler->getDraggedWidget()) sourceWidget = mFocusHandler->getDraggedWidget(); - int sourceWidgetX; - int sourceWidgetY; if (sourceWidget) { + int sourceWidgetX; + int sourceWidgetY; + sourceWidget->getAbsolutePosition(sourceWidgetX, sourceWidgetY); distributeMouseEvent(sourceWidget, MouseEventType::WHEEL_MOVED_UP, |