From c98621691a75b890c3d8368635be9893daa43652 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 15 Jan 2020 18:45:06 +0000 Subject: [PATCH] Don't allow degenerate arcs & circles. Trouble will follow. --- pcbnew/class_drawsegment.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pcbnew/class_drawsegment.h b/pcbnew/class_drawsegment.h index 0e3b273ba8..60e87fbe93 100644 --- a/pcbnew/class_drawsegment.h +++ b/pcbnew/class_drawsegment.h @@ -149,7 +149,9 @@ public: int GetRadius() const { double radius = GetLineLength( m_Start, m_End ); - return KiROUND( radius ); + + // don't allow degenerate arcs + return std::max( 1, KiROUND( radius ) ); } /**