From 6ab1b2c653d1c526ca28c457b7486cfa3d2c8c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Capello?= Date: Mon, 15 May 2023 10:32:54 -0300 Subject: [PATCH] Revert "Fix crash in app::tools::BaseInk::prepareForPointShape" because it breaks other tools functionality (fix #3869) --- src/app/ui/editor/drawing_state.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/app/ui/editor/drawing_state.cpp b/src/app/ui/editor/drawing_state.cpp index 8ba1d7293..1902cc290 100644 --- a/src/app/ui/editor/drawing_state.cpp +++ b/src/app/ui/editor/drawing_state.cpp @@ -86,16 +86,6 @@ void DrawingState::initToolLoop(Editor* editor, const ui::MouseMessage* msg, const tools::Pointer& pointer) { - // This line was moved here to avoid a crash in app::tools::BaseInk::prepareForPointShape - // where m_proc was null when m_delayedMouseMove.onMouseDown was called. Then by calling - // prepareLoop we make sure m_proc is properly set before the m_delayedMouseMove.onMouseDown - // call (Issue: https://github.com/aseprite/aseprite/issues/3338 ) - m_toolLoopManager->prepareLoop(pointer); - // This line was moved here because the previous prepareLoop call might set the toolLoop - // controller to null, which would make the app crash. Then by calling pressButton we make - // sure the toolLoop controller is properly set. - m_toolLoopManager->pressButton(pointer); - if (msg) m_delayedMouseMove.onMouseDown(msg); else @@ -130,6 +120,9 @@ void DrawingState::initToolLoop(Editor* editor, editor->editorToScreen(pointer.point())); m_mouseDownTime = base::current_tick(); + m_toolLoopManager->prepareLoop(pointer); + m_toolLoopManager->pressButton(pointer); + ASSERT(!m_toolLoopManager->isCanceled()); editor->captureMouse();