Fix logic.

This commit is contained in:
Relintai 2024-07-14 07:37:05 +02:00
parent 1d20785663
commit 59d5eedf61
2 changed files with 5 additions and 3 deletions

View File

@ -1028,9 +1028,9 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
// Keep track internally of which mouse buttons are pressed
// so we can disallow changing tool.
if (mb->is_pressed()) {
_mouse_buttons_pressed |= mb->get_button_index();
_mouse_buttons_pressed |= (1 << mb->get_button_index());
} else {
_mouse_buttons_pressed &= ~mb->get_button_index();
_mouse_buttons_pressed &= ~(1 << mb->get_button_index());
}
if (mb->get_button_index() == BUTTON_LEFT) {
@ -1948,6 +1948,8 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) {
editor = p_editor;
undo_redo = EditorNode::get_undo_redo();
_mouse_buttons_pressed = 0;
tool = TOOL_NONE;
selection_active = false;
mouse_over = false;

View File

@ -111,7 +111,7 @@ class TileMapEditor : public VBoxContainer {
Tool tool;
Tool last_tool;
uint32_t _mouse_buttons_pressed = 0;
uint32_t _mouse_buttons_pressed;
bool selection_active;
bool mouse_over;