From 0bc97b7952eb144d1a80811372caeba906b53e31 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 15 Jun 2022 18:06:34 +0100 Subject: [PATCH] Handle double-click in dimension drawing tool. Fixes https://gitlab.com/kicad/code/kicad/issues/11815 (cherry picked from commit d40664d171af0d257e9230715e3aead6e1fbec32) --- pcbnew/tools/drawing_tool.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 17a7952734..e2cc7bb9c6 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -857,7 +857,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent ) { m_menu.ShowContextMenu( selection() ); } - else if( evt->IsClick( BUT_LEFT ) ) + else if( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) ) { switch( step ) { @@ -987,12 +987,16 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent ) break; } - if( ++step == FINISHED ) + if( ++step >= FINISHED ) { step = SET_ORIGIN; m_controls->SetAutoPan( false ); m_controls->CaptureCursor( false ); } + else if( evt->IsDblClick( BUT_LEFT ) ) + { + m_toolMgr->RunAction( PCB_ACTIONS::cursorClick, false ); + } } else if( evt->IsMotion() ) {