From 01a343f28ebcfd9cd173886dd3a199cdc89ab28e Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 5 Jul 2019 02:23:26 +0100 Subject: [PATCH] Fix crash when re-entering a drag operation with a move. Fixes: lp:1834111 * https://bugs.launchpad.net/kicad/+bug/1834111 --- pcbnew/tools/edit_tool.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 673f1d6ccf..21bd678df4 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -405,6 +405,9 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent ) OPT_TOOL_EVENT evt = aEvent; VECTOR2I prevPos; + // Prime the pump + m_toolMgr->RunAction( ACTIONS::refreshPreview ); + // Main loop: keep receiving events do { @@ -455,6 +458,8 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent ) if( lockFlags == SELECTION_LOCKED ) break; + m_dragging = true; + // When editing modules, all items have the same parent if( EditingModules() ) { @@ -513,7 +518,6 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent ) prevPos = m_cursor; controls->SetAutoPan( true ); - m_dragging = true; } m_toolMgr->RunAction( PCB_ACTIONS::selectionModified, false );