diff --git a/common/lc_mainwindow.cpp b/common/lc_mainwindow.cpp index 649f900f..5a758814 100644 --- a/common/lc_mainwindow.cpp +++ b/common/lc_mainwindow.cpp @@ -2141,7 +2141,8 @@ void lcMainWindow::UpdateModels() mPartSelectionWidget->UpdateModels(); if (mCurrentPieceInfo && mCurrentPieceInfo->IsModel()) - SetCurrentPieceInfo(nullptr); + if (Models.FindIndex(mCurrentPieceInfo->GetModel()) == -1) + SetCurrentPieceInfo(nullptr); } void lcMainWindow::UpdateCategories() diff --git a/common/lc_partselectionwidget.cpp b/common/lc_partselectionwidget.cpp index fd1c8f6e..85dc8430 100644 --- a/common/lc_partselectionwidget.cpp +++ b/common/lc_partselectionwidget.cpp @@ -1087,7 +1087,7 @@ void lcPartSelectionWidget::UpdateCategories() if (CurrentType == lcPartCategoryType::AllParts && CurrentIndex == 0) CurrentItem = AllPartsCategoryItem; - QTreeWidgetItem* CurrentModelCategoryItem = new QTreeWidgetItem(mCategoriesWidget, QStringList(tr("Parts In Use"))); + QTreeWidgetItem* CurrentModelCategoryItem = new QTreeWidgetItem(mCategoriesWidget, QStringList(tr("In Use"))); CurrentModelCategoryItem->setData(0, static_cast(lcPartCategoryRole::Type), static_cast(lcPartCategoryType::PartsInUse)); if (CurrentType == lcPartCategoryType::PartsInUse && CurrentIndex == 0) diff --git a/common/piece.cpp b/common/piece.cpp index 73951804..a525af62 100644 --- a/common/piece.cpp +++ b/common/piece.cpp @@ -521,7 +521,7 @@ void lcPiece::DrawInterface(lcContext* Context, const lcScene& Scene) const const lcVector3& Max = BoundingBox.Max; lcVector3 Edge((Max - Min) * 0.33f); - float LineVerts[48][3] = + const float LineVerts[48][3] = { { Max[0], Max[1], Max[2] }, { Max[0] - Edge[0], Max[1], Max[2] }, { Max[0], Max[1], Max[2] }, { Max[0], Max[1] - Edge[1], Max[2] }, @@ -593,7 +593,7 @@ void lcPiece::DrawInterface(lcContext* Context, const lcScene& Scene) const Context->DrawIndexedPrimitives(GL_LINES, 24, GL_UNSIGNED_SHORT, 0); } - if (AreControlPointsVisible()) + if (!mControlPoints.IsEmpty() && AreControlPointsVisible()) { float Verts[8 * 3]; float* CurVert = Verts; diff --git a/common/view.cpp b/common/view.cpp index 6daa4b8d..b6ccf475 100644 --- a/common/view.cpp +++ b/common/view.cpp @@ -822,7 +822,7 @@ void View::OnDraw() if (Info) { - lcMatrix44 WorldMatrix = GetPieceInsertPosition(false, gMainWindow->GetCurrentPieceInfo()); + lcMatrix44 WorldMatrix = GetPieceInsertPosition(false, Info); if (GetActiveModel() != mModel) WorldMatrix = lcMul(WorldMatrix, mActiveSubmodelTransform);