From ca1ca6c7df00918db594c0ca95fd1b8bcaa58ac4 Mon Sep 17 00:00:00 2001 From: Saracen Date: Thu, 17 Mar 2016 23:10:09 +0000 Subject: [PATCH] Fix cursor getting locked on tree control if tree is cleared while modifying numerical element. (cherry picked from commit 44fe74bfc3df6ac8251ebc4b678c99a7ad122dbb) --- scene/gui/tree.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index f793bbe3c64..554fd932dbd 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2743,6 +2743,15 @@ void Tree::clear() { ERR_FAIL_COND(blocked>0); } + if (pressing_for_editor) { + if (range_drag_enabled) { + range_drag_enabled = false; + Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE); + warp_mouse(range_drag_capture_pos); + } + pressing_for_editor = false; + } + if (root) { memdelete( root ); root = NULL; @@ -2752,7 +2761,6 @@ void Tree::clear() { edited_item=NULL; popup_edited_item=NULL; selected_item=NULL; - pressing_for_editor=false; update(); };