From e6240b1d845a1df812add919923278fef72ae90d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 3 Oct 2022 18:55:32 +0100 Subject: Translate mouse motion y axis --- ui/window.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ui') 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; -- cgit v1.2.3