From fd0381ea09c08f7c488e55656cf0f956e26a280e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20W=C5=82ostowski?= Date: Mon, 28 Jan 2019 10:28:50 +0100 Subject: [PATCH] router: fix dragging when dragged segment has adjacent segment(s) at 180 degree angle Fixes: lp:1812535 * https://bugs.launchpad.net/kicad/+bug/1812535 --- pcbnew/router/pns_line.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pcbnew/router/pns_line.cpp b/pcbnew/router/pns_line.cpp index 87c8603505..098988067c 100644 --- a/pcbnew/router/pns_line.cpp +++ b/pcbnew/router/pns_line.cpp @@ -625,7 +625,7 @@ void LINE::dragSegment45( const VECTOR2I& aP, int aIndex, int aSnappingThreshold } else { - if( dir_prev.IsObtuse(drag_dir ) ) + if( dir_prev.Angle( drag_dir ) & (DIRECTION_45::ANG_OBTUSE | DIRECTION_45::ANG_HALF_FULL) ) { guideA[0] = SEG( s_prev.A, s_prev.A + drag_dir.Left().ToVector() ); guideA[1] = SEG( s_prev.A, s_prev.A + drag_dir.Right().ToVector() ); @@ -649,13 +649,14 @@ void LINE::dragSegment45( const VECTOR2I& aP, int aIndex, int aSnappingThreshold } else { - if( dir_next.IsObtuse( drag_dir ) ) + if( dir_next.Angle( drag_dir ) & (DIRECTION_45::ANG_OBTUSE | DIRECTION_45::ANG_HALF_FULL) ) { guideB[0] = SEG( s_next.B, s_next.B + drag_dir.Left().ToVector() ); guideB[1] = SEG( s_next.B, s_next.B + drag_dir.Right().ToVector() ); } else guideB[0] = guideB[1] = SEG( dragged.B, dragged.B + dir_next.ToVector() ); + } SEG s_current( target, target + drag_dir.ToVector() );