Skip to content

Commit

Permalink
Merge pull request #72866 from Sauermann/fix-release-button-mask
Browse files Browse the repository at this point in the history
Fix mouse-button-mask on button release in unit test
  • Loading branch information
akien-mga committed Feb 8, 2023
2 parents 9f85deb + 39d79ce commit 9f859a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/input/input_enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down
2 changes: 1 addition & 1 deletion tests/scene/test_text_edit.h
Original file line number Diff line number Diff line change
Expand Up @@ -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() == "");
Expand Down

0 comments on commit 9f859a1

Please sign in to comment.