Fixed a case where drag and drop a submodel didn't do anything.

This commit is contained in:
Leonardo Zide 2020-02-01 11:34:56 -08:00
parent 60aca425a0
commit fb7f952e98
4 changed files with 6 additions and 5 deletions

View file

@ -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()

View file

@ -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<int>(lcPartCategoryRole::Type), static_cast<int>(lcPartCategoryType::PartsInUse));
if (CurrentType == lcPartCategoryType::PartsInUse && CurrentIndex == 0)

View file

@ -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;

View file

@ -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);