Handle double-click in dimension drawing tool.

Fixes https://gitlab.com/kicad/code/kicad/issues/11815

(cherry picked from commit d40664d171)
This commit is contained in:
Jeff Young 2022-06-15 18:06:34 +01:00
parent 52157acbfe
commit 0bc97b7952
1 changed files with 6 additions and 2 deletions

View File

@ -857,7 +857,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
{ {
m_menu.ShowContextMenu( selection() ); m_menu.ShowContextMenu( selection() );
} }
else if( evt->IsClick( BUT_LEFT ) ) else if( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) )
{ {
switch( step ) switch( step )
{ {
@ -987,12 +987,16 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
break; break;
} }
if( ++step == FINISHED ) if( ++step >= FINISHED )
{ {
step = SET_ORIGIN; step = SET_ORIGIN;
m_controls->SetAutoPan( false ); m_controls->SetAutoPan( false );
m_controls->CaptureCursor( false ); m_controls->CaptureCursor( false );
} }
else if( evt->IsDblClick( BUT_LEFT ) )
{
m_toolMgr->RunAction( PCB_ACTIONS::cursorClick, false );
}
} }
else if( evt->IsMotion() ) else if( evt->IsMotion() )
{ {