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
This commit is contained in:
Seth Hillbrand 2018-12-09 07:21:17 -08:00
parent f6aed7c99a
commit dfe4b3412a
1 changed files with 2 additions and 2 deletions

View File

@ -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