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
This commit is contained in:
Jeff Young 2020-12-10 22:08:09 +00:00
parent ddd026da87
commit 6898dadd1c
1 changed files with 4 additions and 1 deletions

View File

@ -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 );
};