diff options
Diffstat (limited to 'ui/uiComponent.cpp')
-rw-r--r-- | ui/uiComponent.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ui/uiComponent.cpp b/ui/uiComponent.cpp index ef62db9..e480fbc 100644 --- a/ui/uiComponent.cpp +++ b/ui/uiComponent.cpp @@ -23,5 +23,10 @@ UIComponent::Position::operator&(const glm::vec2 & pos) const bool UIComponent::Position::operator&(const SDL_MouseButtonEvent & pos) const { - return *this & glm::vec2 {pos.x, pos.y}; + switch (pos.type) { + case SDL_MOUSEBUTTONUP: + case SDL_MOUSEBUTTONDOWN: + return *this & glm::vec2 {pos.x, pos.y}; + } + return false; } |