From 39d79ce2170dd4b62d739e30e430991a70913173 Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Wed, 8 Feb 2023 01:17:40 +0100 Subject: [PATCH] Fix mouse-button-mask on button release in unit test On mouse-button release, the mask is 0. --- core/input/input_enums.h | 1 + tests/scene/test_text_edit.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/input/input_enums.h b/core/input/input_enums.h index 02efde2d302..7974ee639d2 100644 --- a/core/input/input_enums.h +++ b/core/input/input_enums.h @@ -122,6 +122,7 @@ enum class MouseButton { }; enum class MouseButtonMask { + NONE = 0, LEFT = (1 << (int(MouseButton::LEFT) - 1)), RIGHT = (1 << (int(MouseButton::RIGHT) - 1)), MIDDLE = (1 << (int(MouseButton::MIDDLE) - 1)), diff --git a/tests/scene/test_text_edit.h b/tests/scene/test_text_edit.h index 77312a86045..a9730ce8203 100644 --- a/tests/scene/test_text_edit.h +++ b/tests/scene/test_text_edit.h @@ -1161,7 +1161,7 @@ TEST_CASE("[SceneTree][TextEdit] text entry") { SEND_GUI_MOUSE_MOTION_EVENT(target_text_edit, line_0, MouseButtonMask::LEFT, Key::NONE); CHECK(text_edit->get_viewport()->gui_is_dragging()); - SEND_GUI_MOUSE_BUTTON_RELEASED_EVENT(target_text_edit, line_0, MouseButton::LEFT, MouseButtonMask::LEFT, Key::NONE); + SEND_GUI_MOUSE_BUTTON_RELEASED_EVENT(target_text_edit, line_0, MouseButton::LEFT, MouseButtonMask::NONE, Key::NONE); CHECK_FALSE(text_edit->get_viewport()->gui_is_dragging()); CHECK(text_edit->get_text() == "");