From 4b5ca0ec14d0086254a79cee7a302f47615fbe95 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Sat, 24 Mar 2018 23:56:18 +0100 Subject: [PATCH] Drawing tool: prevent creating zero-length lines Fixes: lp:1758570 * https://bugs.launchpad.net/kicad/+bug/1758570 --- pcbnew/tools/drawing_tool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index f085ce9900..f16dee8734 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -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 )