From 3d4bf1c3c95c12903797746b9ddc8f57944ad5fd Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 1 Sep 2022 01:56:59 +0200 Subject: [PATCH] Improved PaintWindow mouse emulation from touch support a bit more. --- modules/paint/paint_window.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/paint/paint_window.cpp b/modules/paint/paint_window.cpp index 4d481d757..f765fbbfa 100644 --- a/modules/paint/paint_window.cpp +++ b/modules/paint/paint_window.cpp @@ -255,7 +255,7 @@ void PaintWindow::_input(const Ref &event) { Rect2 rect = Rect2(Vector2(0, 0), paint_canvas->get_size()); bool has_point = rect.has_point(mouse_position); - if (has_point && !paint_canvas->mouse_in_region) { + if ((has_point && !paint_canvas->mouse_in_region) || iemb->is_pressed()) { paint_canvas->mouse_in_region = true; _on_PaintCanvasContainer_mouse_entered(); paint_canvas->_on_mouse_entered(); @@ -274,6 +274,7 @@ void PaintWindow::_input(const Ref &event) { last_cell_color = cell_color; _last_mouse_pos_canvas_area = get_global_mouse_position(); //paint_canvas_container_node.get_local_mouse_position() + paint_canvas->clear_preview_layer(); } } @@ -339,7 +340,7 @@ void PaintWindow::_input(const Ref &event) { Rect2 rect = Rect2(Vector2(0, 0), paint_canvas->get_size()); bool has_point = rect.has_point(mouse_position); - if (!has_point && paint_canvas->mouse_in_region) { + if ((!has_point && paint_canvas->mouse_in_region) || !iemb->is_pressed()) { paint_canvas->mouse_in_region = false; _on_PaintCanvasContainer_mouse_exited(); paint_canvas->_on_mouse_exited();