mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
Chess: Allow right click to cancel drag move while dragging a piece
This commit is contained in:
parent
c2c7c7368b
commit
44aeab43a0
1 changed files with 5 additions and 1 deletions
|
@ -168,7 +168,11 @@ void ChessWidget::mousedown_event(GUI::MouseEvent& event)
|
||||||
GUI::Widget::mousedown_event(event);
|
GUI::Widget::mousedown_event(event);
|
||||||
|
|
||||||
if (event.button() == GUI::MouseButton::Right) {
|
if (event.button() == GUI::MouseButton::Right) {
|
||||||
|
if (m_dragging_piece) {
|
||||||
|
m_dragging_piece = false;
|
||||||
|
} else {
|
||||||
m_current_marking.from = mouse_to_square(event);
|
m_current_marking.from = mouse_to_square(event);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_board_markings.clear();
|
m_board_markings.clear();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue