From 1a3b129d1eb274305d92b0875ff403a5e0e49343 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 7 Jun 2019 21:33:09 -0700 Subject: [PATCH] pcbnew: Don't reset triangular points for intersection We prevent the creation of invalid polygons by keeping the converging lines from intersecting. This test doesn't make sense for triangular polygons as they always intersect and we want to allow them to move outside of the singular point. Fixes: lp:1831481 * https://bugs.launchpad.net/kicad/+bug/1831481 (cherry picked from commit 966173c129469d9ecf6be3e3b914802056a0868c) --- common/tool/edit_constraints.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/tool/edit_constraints.cpp b/common/tool/edit_constraints.cpp index e46ad49032..9194ca8a65 100644 --- a/common/tool/edit_constraints.cpp +++ b/common/tool/edit_constraints.cpp @@ -173,8 +173,12 @@ void EC_CONVERGING::Apply( EDIT_LINE& aHandle ) if( OPT_VECTOR2I originEndIntersect = endSide.Intersect( originSide ) ) { - origin.SetPosition( *originEndIntersect ); - end.SetPosition( *originEndIntersect ); + // Triangle intersect by definition + if( m_editPoints.LinesSize() > 3 ) + { + origin.SetPosition( *originEndIntersect ); + end.SetPosition( *originEndIntersect ); + } } }