Prevent multiple single-point line solutions
Suggested by @rivimey, we test the case where both lines return singular
point lines and prevent them leaking into our drag solution
Fixes https://gitlab.com/kicad/code/kicad/issues/9555
(cherry picked from commit 38a4894d92
)
This commit is contained in:
parent
2900910cdd
commit
ad84b62b63
|
@ -504,13 +504,20 @@ bool DRAGGER::tryWalkaround( NODE* aNode, LINE& aOrig, LINE& aWalk )
|
|||
|
||||
WALKAROUND::RESULT wr = walkaround.Route( aWalk );
|
||||
|
||||
|
||||
if( wr.statusCcw == WALKAROUND::DONE && wr.statusCw == WALKAROUND::DONE )
|
||||
{
|
||||
aWalk = ( wr.lineCw.CLine().Length() < wr.lineCcw.CLine().Length() ? wr.lineCw :
|
||||
wr.lineCcw );
|
||||
if( wr.lineCw.CLine().PointCount() > 1
|
||||
&& wr.lineCw.CLine().Length() < wr.lineCcw.CLine().Length() )
|
||||
{
|
||||
aWalk = wr.lineCw;
|
||||
ok = true;
|
||||
}
|
||||
else if( wr.lineCcw.CLine().PointCount() > 1 )
|
||||
{
|
||||
aWalk = wr.lineCcw;
|
||||
ok = true;
|
||||
}
|
||||
}
|
||||
else if( wr.statusCw == WALKAROUND::DONE && wr.lineCw.CLine().PointCount() > 1 )
|
||||
{
|
||||
aWalk = wr.lineCw;
|
||||
|
@ -521,6 +528,7 @@ bool DRAGGER::tryWalkaround( NODE* aNode, LINE& aOrig, LINE& aWalk )
|
|||
aWalk = wr.lineCcw;
|
||||
ok = true;
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue