Be more diligent in preventing drag line errors

They can happen even when there are no collisions, so we need to reset
the 'ok' flag before using the line again.

Fixes https://gitlab.com/kicad/code/kicad/issues/9555

(cherry picked from commit 833ce19221)
This commit is contained in:
Seth Hillbrand 2022-01-31 16:08:15 -08:00
parent 82ceaf0d9b
commit 803675195d
1 changed files with 3 additions and 0 deletions

View File

@ -573,6 +573,9 @@ bool DRAGGER::dragWalkaround( const VECTOR2I& aP )
ok = true; ok = true;
} }
if( draggedWalk.CLine().PointCount() < 2 )
ok = false;
if( ok ) if( ok )
{ {
PNS_DBG( Dbg(), AddLine, origLine.CLine(), BLUE, 50000, "drag-orig-line" ); PNS_DBG( Dbg(), AddLine, origLine.CLine(), BLUE, 50000, "drag-orig-line" );