mirror of
https://github.com/leozide/leocad
synced 2025-01-18 22:26:44 +01:00
Fixed a case where drag and drop a submodel didn't do anything.
This commit is contained in:
parent
60aca425a0
commit
fb7f952e98
4 changed files with 6 additions and 5 deletions
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue