3D Preview - ignore update if existing piece and color matches

This commit is contained in:
Trevor SANDY 2020-10-08 15:17:31 +02:00
parent 959c815ad1
commit bdc4061a79

View file

@ -107,9 +107,19 @@ bool lcPreviewWidget::SetCurrentPiece(const QString& PartType, int ColorCode)
if (Info) if (Info)
{ {
lcModel* ActiveModel = GetActiveModel();
for (lcPiece* ModelPiece : ActiveModel->GetPieces())
{
if (Info == ModelPiece->mPieceInfo)
{
int ModelColorCode = ModelPiece->mColorCode;
if (ModelColorCode == ColorCode)
return true;
}
}
mIsModel = Info->IsModel(); mIsModel = Info->IsModel();
mDescription = Info->m_strDescription; mDescription = Info->m_strDescription;
lcModel* ActiveModel = GetActiveModel();
ActiveModel->SelectAllPieces(); ActiveModel->SelectAllPieces();
ActiveModel->DeleteSelectedObjects(); ActiveModel->DeleteSelectedObjects();