router: fix dragging when dragged segment has adjacent segment(s) at 180 degree angle
Fixes: lp:1812535 * https://bugs.launchpad.net/kicad/+bug/1812535
This commit is contained in:
parent
e850a482d1
commit
fd0381ea09
|
@ -625,7 +625,7 @@ void LINE::dragSegment45( const VECTOR2I& aP, int aIndex, int aSnappingThreshold
|
||||||
}
|
}
|
||||||
else
|
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[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() );
|
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
|
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[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() );
|
guideB[1] = SEG( s_next.B, s_next.B + drag_dir.Right().ToVector() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
guideB[0] = guideB[1] = SEG( dragged.B, dragged.B + dir_next.ToVector() );
|
guideB[0] = guideB[1] = SEG( dragged.B, dragged.B + dir_next.ToVector() );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SEG s_current( target, target + drag_dir.ToVector() );
|
SEG s_current( target, target + drag_dir.ToVector() );
|
||||||
|
|
Loading…
Reference in New Issue