diff options
author | Brendan Coles <bcoles@gmail.com> | 2021-02-18 08:16:17 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-18 12:52:11 +0100 |
commit | 44aeab43a0e273bf275a65588b909120e43937d8 (patch) | |
tree | dcbc3ab15d8fd9d01e6a89803224e52a0ca0573d /Userland/Games/Chess | |
parent | c2c7c7368b749cca5f182b01231c56aac24a5062 (diff) | |
download | serenity-44aeab43a0e273bf275a65588b909120e43937d8.zip |
Chess: Allow right click to cancel drag move while dragging a piece
Diffstat (limited to 'Userland/Games/Chess')
-rw-r--r-- | Userland/Games/Chess/ChessWidget.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Userland/Games/Chess/ChessWidget.cpp b/Userland/Games/Chess/ChessWidget.cpp index 6d74a5da20..c3c083f8d0 100644 --- a/Userland/Games/Chess/ChessWidget.cpp +++ b/Userland/Games/Chess/ChessWidget.cpp @@ -168,7 +168,11 @@ void ChessWidget::mousedown_event(GUI::MouseEvent& event) GUI::Widget::mousedown_event(event); if (event.button() == GUI::MouseButton::Right) { - m_current_marking.from = mouse_to_square(event); + if (m_dragging_piece) { + m_dragging_piece = false; + } else { + m_current_marking.from = mouse_to_square(event); + } return; } m_board_markings.clear(); |