From dfe4b3412ab4ece54fbc01703677f190f99defd5 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sun, 9 Dec 2018 07:21:17 -0800 Subject: [PATCH] pcbnew: Fix bug in adding new zone/poly The next point wasn't updated unless the line was in 45-degree mode. Fixes: lp:1807591 * https://bugs.launchpad.net/kicad/+bug/1807591 --- common/preview_items/polygon_geom_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/preview_items/polygon_geom_manager.cpp b/common/preview_items/polygon_geom_manager.cpp index 86c64d3324..2117974d26 100644 --- a/common/preview_items/polygon_geom_manager.cpp +++ b/common/preview_items/polygon_geom_manager.cpp @@ -144,13 +144,13 @@ void POLYGON_GEOM_MANAGER::updateLeaderPoints( const VECTOR2I& aEndPoint, LEADER { wxCHECK( m_lockedPoints.PointCount() > 0, /*void*/ ); const VECTOR2I& lastPt = m_lockedPoints.CLastPoint(); - auto newEnd = VECTOR2I( lastPt ); + auto newEnd = VECTOR2I( aEndPoint ); if( m_leaderMode == LEADER_MODE::DEG45 || aModifier == LEADER_MODE::DEG45 ) { const VECTOR2I lineVector( aEndPoint - lastPt ); // get a restricted 45/H/V line from the last fixed point to the cursor - newEnd += GetVectorSnapped45( lineVector ); + newEnd = lastPt + GetVectorSnapped45( lineVector ); } // direct segment