1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:07:34 +00:00

Chess: Don't attempt to update the board when clicking out of bounds

Previously, clicking outside the bounds of the board when the window
was resized, could cause a crash.
This commit is contained in:
Tim Ledbetter 2023-04-29 16:04:52 +01:00 committed by Jelle Raaijmakers
parent 852bf35c1e
commit 55d573afa4
2 changed files with 41 additions and 17 deletions

View file

@ -1,6 +1,7 @@
/*
* Copyright (c) 2020-2022, the SerenityOS developers.
* Copyright (c) 2023, Sam Atkins <atkinssj@serenityos.org>
* Copyright (c) 2023, Tim Ledbetter <timledbetter@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -44,7 +45,7 @@ public:
void set_piece_set(StringView set);
DeprecatedString const& piece_set() const { return m_piece_set; };
Chess::Square mouse_to_square(GUI::MouseEvent& event) const;
Optional<Chess::Square> mouse_to_square(GUI::MouseEvent& event) const;
bool drag_enabled() const { return m_drag_enabled; }
void set_drag_enabled(bool e) { m_drag_enabled = e; }