Fix freeze for find/replace

The loop was not terminated properly if pieces were invisible.

Fixes leozide/leocad#901
This commit is contained in:
Gerd Wachsmuth 2024-01-13 13:34:55 +01:00
parent c84a730ce4
commit eae65819f2

View file

@ -4192,10 +4192,7 @@ void lcModel::FindReplacePiece(bool SearchForward, bool FindAll)
lcPiece* Current = mPieces[CurrentIdx];
if (!Current->IsVisible(mCurrentStep))
continue;
if (PieceMatches(Current))
if (Current->IsVisible(mCurrentStep) && PieceMatches(Current))
{
if (FindAll)
Selection.Add(Current);