From 6898dadd1c56545efd5354281f27a4570634b8da Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 10 Dec 2020 22:08:09 +0000 Subject: [PATCH] Don't activate measure tool when it's already running. In this case it's reactivated when the move command ends; only the move command was ended because of activating the measure tool so it gets activated twice. Fixes https://gitlab.com/kicad/code/kicad/issues/6321 --- pcbnew/tools/pcb_viewer_tools.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcbnew/tools/pcb_viewer_tools.cpp b/pcbnew/tools/pcb_viewer_tools.cpp index f4b9cfd963..6f213e7a3d 100644 --- a/pcbnew/tools/pcb_viewer_tools.cpp +++ b/pcbnew/tools/pcb_viewer_tools.cpp @@ -197,6 +197,9 @@ int PCB_VIEWER_TOOLS::MeasureTool( const TOOL_EVENT& aEvent ) if( IsFootprintFrame() && !frame()->GetModel() ) return 0; + if( frame()->IsCurrentTool( ACTIONS::measureTool ) ) + return 0; + auto& view = *getView(); auto& controls = *getViewControls(); @@ -221,7 +224,7 @@ int PCB_VIEWER_TOOLS::MeasureTool( const TOOL_EVENT& aEvent ) controls.CaptureCursor( false ); auto setCursor = - [&]() + [&]() { frame()->GetCanvas()->SetCurrentCursor( KICURSOR::MEASURE ); };