From 20de1b2b4ffe4a24c36f291a46a85dd4616035a5 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 20 Aug 2020 20:00:27 -0700 Subject: [PATCH] Minor code tightening --- pcbnew/tools/drawing_tool.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index c46be075e8..f121481d8d 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -1170,14 +1170,7 @@ bool DRAWING_TOOL::drawSegment( const std::string& aTool, int aShape, DRAWSEGMEN // If the user clicks on an existing snap point from a drawsegment // we finish the segment as they are likely closing a path - double graphicLength; - - if( aShape != S_RECT ) - graphicLength = graphic->GetLength(); // Get actual length for non-rects - else - graphicLength = 1.0; // Set to 1.0 so conditional below succeeds for rects - - if( snapItem && graphicLength > 0.0 ) + if( snapItem && ( aShape == S_RECT || graphic->GetLength() > 0.0 ) ) { commit.Add( graphic ); commit.Push( _( "Draw a line segment" ) );