Ensure grid index is valid before trying to change value.
(cherry picked from commit f98acd5cfb
)
This commit is contained in:
parent
0c1f88c769
commit
3e50d3b4c0
1 changed files with 1 additions and 1 deletions
|
@ -641,7 +641,7 @@ public:
|
|||
|
||||
const Ref<InputEventMouseButton> mb = p_ev;
|
||||
|
||||
if (mb.is_valid() && mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) {
|
||||
if (mb.is_valid() && mb->get_button_index() == BUTTON_LEFT && mb->is_pressed() && hovered_index > 0) {
|
||||
// Toggle the flag.
|
||||
// We base our choice on the hovered flag, so that it always matches the hovered flag.
|
||||
if (value & (1 << hovered_index)) {
|
||||
|
|
Loading…
Reference in a new issue