Finish single-click-place drawing tool on double-click.

Fixes https://gitlab.com/kicad/code/kicad/issues/5907
This commit is contained in:
Jeff Young 2020-10-07 18:05:09 +01:00
parent 75185f6723
commit 809f4c2ffb
1 changed files with 7 additions and 1 deletions

View File

@ -504,7 +504,7 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent )
break; break;
} }
} }
else if( evt->IsClick( BUT_LEFT ) ) else if( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) )
{ {
if( !m_frame->GetScreen()->GetItem( cursorPos, 0, type ) ) if( !m_frame->GetScreen()->GetItem( cursorPos, 0, type ) )
{ {
@ -523,6 +523,12 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent )
m_frame->OnModify(); m_frame->OnModify();
} }
} }
if( evt->IsDblClick( BUT_LEFT ) ) // Finish tool.
{
m_frame->PopTool( tool );
break;
}
} }
else if( evt->IsClick( BUT_RIGHT ) ) else if( evt->IsClick( BUT_RIGHT ) )
{ {