diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-10-03 18:55:32 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-10-03 18:55:32 +0100 |
commit | e6240b1d845a1df812add919923278fef72ae90d (patch) | |
tree | 9c6c7c83e26515939d42d685fc52ac610a8628a9 | |
parent | Add WorldOverlay concept (diff) | |
download | ilt-e6240b1d845a1df812add919923278fef72ae90d.tar.bz2 ilt-e6240b1d845a1df812add919923278fef72ae90d.tar.xz ilt-e6240b1d845a1df812add919923278fef72ae90d.zip |
Translate mouse motion y axis
-rw-r--r-- | ui/window.cpp | 4 |
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;
|