From 68f8a22b80fdf61c89c34f2383c79d0853ce9dd2 Mon Sep 17 00:00:00 2001 From: Evgeny Prikazchikov Date: Mon, 25 Dec 2023 21:30:27 +0300 Subject: [PATCH] Editor: Canceling of the drag doesn't work complete #646 --- .../screens/scenecomposer/objectcontroller.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/worldeditor/src/screens/scenecomposer/objectcontroller.cpp b/worldeditor/src/screens/scenecomposer/objectcontroller.cpp index 9ff165d8f..70f6a1f89 100644 --- a/worldeditor/src/screens/scenecomposer/objectcontroller.cpp +++ b/worldeditor/src/screens/scenecomposer/objectcontroller.cpp @@ -34,6 +34,8 @@ #include #include +#include + namespace { const char *gBackgroundColor("General/Colors/Background_Color"); const char *gIsolationColor("General/Colors/Isolation_Color"); @@ -229,6 +231,15 @@ void ObjectController::update() { } } + if(Input::isMouseButtonDown(Input::MOUSE_LEFT)) { + if(!m_drag) { + if(Handles::s_Axes) { + m_axes = Handles::s_Axes; + setDrag(true); + } + } + } + if(Input::isMouseButtonUp(Input::MOUSE_LEFT)) { if(!m_drag) { if(!m_canceled) { @@ -282,10 +293,6 @@ void ObjectController::update() { if(Input::isKey(Input::KEY_LEFT_SHIFT)) { UndoManager::instance()->push(new DuplicateObjects(this)); } - if(Handles::s_Axes) { - m_axes = Handles::s_Axes; - setDrag(true); - } } else { emit sceneUpdated(nullptr); }