summaryrefslogtreecommitdiff
path: root/ui/window.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-10-03 18:55:32 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2022-10-03 18:55:32 +0100
commite6240b1d845a1df812add919923278fef72ae90d (patch)
tree9c6c7c83e26515939d42d685fc52ac610a8628a9 /ui/window.cpp
parentAdd WorldOverlay concept (diff)
downloadilt-e6240b1d845a1df812add919923278fef72ae90d.tar.bz2
ilt-e6240b1d845a1df812add919923278fef72ae90d.tar.xz
ilt-e6240b1d845a1df812add919923278fef72ae90d.zip
Translate mouse motion y axis
Diffstat (limited to 'ui/window.cpp')
-rw-r--r--ui/window.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/window.cpp b/ui/window.cpp
index 3569915..73ed0c1 100644
--- a/ui/window.cpp
+++ b/ui/window.cpp
@@ -63,6 +63,10 @@ Window::handleInput(const SDL_Event & e)
SDL_GetWindowSize(m_window, &size.x, &size.y);
eAdjusted.button.y = size.y - e.button.y;
break;
+ case SDL_MOUSEMOTION:
+ SDL_GetWindowSize(m_window, &size.x, &size.y);
+ eAdjusted.motion.y = size.y - e.motion.y;
+ break;
}
uiComponents.rapplyOne(&UIComponent::handleInput, eAdjusted, UIComponent::Position {{}, size});
return true;