diff --git a/code/classeine-lib/clsn/ui/clickable_control.cpp b/code/classeine-lib/clsn/ui/clickable_control.cpp index 91a619a18..25109042e 100644 --- a/code/classeine-lib/clsn/ui/clickable_control.cpp +++ b/code/classeine-lib/clsn/ui/clickable_control.cpp @@ -49,10 +49,11 @@ namespace clsn::ui void clickable_control::process_mouse_click_event(events::mouse_click_event& e) { - m_pressed = e.is_button_pressed() && e.is_one_left_click(); + const bool left_click = e.is_left_click(); + m_pressed = e.is_button_pressed() && left_click; this->invalidate(); - if (!m_pressed && e.is_one_left_click()) + if (!m_pressed && left_click) { perform_click(); } diff --git a/code/classeine-lib/clsn/ui/events/mouse_click_event.cpp b/code/classeine-lib/clsn/ui/events/mouse_click_event.cpp index f735cec3b..bb095211d 100644 --- a/code/classeine-lib/clsn/ui/events/mouse_click_event.cpp +++ b/code/classeine-lib/clsn/ui/events/mouse_click_event.cpp @@ -40,9 +40,9 @@ namespace clsn::ui::events return m_button_id; } - auto mouse_click_event::is_one_left_click() const noexcept -> bool + auto mouse_click_event::is_left_click() const noexcept -> bool { - return m_button_id == 1 && m_click_count == 1; + return m_button_id == 1; } auto mouse_click_event::is_button_pressed() const noexcept -> bool diff --git a/code/classeine-lib/clsn/ui/events/mouse_click_event.h b/code/classeine-lib/clsn/ui/events/mouse_click_event.h index 4cf3c92cd..eac2f61b2 100644 --- a/code/classeine-lib/clsn/ui/events/mouse_click_event.h +++ b/code/classeine-lib/clsn/ui/events/mouse_click_event.h @@ -35,7 +35,7 @@ namespace clsn::ui::events [[nodiscard]] auto get_click_count() const noexcept -> int; [[nodiscard]] auto get_button_id() const noexcept -> int; - [[nodiscard]] auto is_one_left_click() const noexcept -> bool; + [[nodiscard]] auto is_left_click() const noexcept -> bool; [[nodiscard]] auto is_button_pressed() const noexcept -> bool; }; } \ No newline at end of file