diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 3779f88aa2..8e84b6634c 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -2055,7 +2055,9 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent ) if( evt->IsCancelInteractive() ) { if( polyGeomMgr.IsPolygonInProgress() ) + { cleanup(); + } else { m_frame->PopTool( tool ); @@ -2198,6 +2200,8 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent ) m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW ); m_controls->ForceCursorPosition( false ); + controls()->SetAutoPan( false ); + m_controls->CaptureCursor( false ); return 0; } diff --git a/pcbnew/tools/pcb_tool_base.cpp b/pcbnew/tools/pcb_tool_base.cpp index cfa697417f..f6b488a72e 100644 --- a/pcbnew/tools/pcb_tool_base.cpp +++ b/pcbnew/tools/pcb_tool_base.cpp @@ -121,7 +121,9 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool, break; } else if( newItem ) + { cleanup(); + } else { frame()->PopTool( aTool ); @@ -258,6 +260,8 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool, view()->Remove( &preview ); frame()->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW ); + controls()->SetAutoPan( false ); + controls()->CaptureCursor( false ); } diff --git a/pcbnew/tools/pcb_viewer_tools.cpp b/pcbnew/tools/pcb_viewer_tools.cpp index ca8ac32796..90cd90c849 100644 --- a/pcbnew/tools/pcb_viewer_tools.cpp +++ b/pcbnew/tools/pcb_viewer_tools.cpp @@ -252,7 +252,9 @@ int PCB_VIEWER_TOOLS::MeasureTool( const TOOL_EVENT& aEvent ) if( evt->IsCancelInteractive() ) { if( originSet ) + { clearRuler(); + } else { frame()->PopTool( tool ); @@ -328,6 +330,8 @@ int PCB_VIEWER_TOOLS::MeasureTool( const TOOL_EVENT& aEvent ) view.Remove( &ruler ); frame()->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW ); + controls.SetAutoPan( false ); + controls.CaptureCursor( false ); return 0; }