Drawing tool: prevent creating zero-length lines

Fixes: lp:1758570
* https://bugs.launchpad.net/kicad/+bug/1758570
This commit is contained in:
Maciej Suminski 2018-03-24 23:56:18 +01:00
parent 4594fedc2c
commit 4b5ca0ec14
1 changed files with 2 additions and 2 deletions

View File

@ -1028,8 +1028,8 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic,
// User has clicked twice in the same spot
{
// a clear sign that the current drawing is finished
// Now we have to add the helper line as well
if( direction45 )
// Now we have to add the helper line as well, unless it is zero-length
if( direction45 && line45.GetStart() != aGraphic->GetStart() )
{
BOARD_ITEM_CONTAINER* parent = m_frame->GetModel();
DRAWSEGMENT* l = m_editModules ? new EDGE_MODULE( (MODULE*) parent )