diff --git a/src/documentwindow.cpp b/src/documentwindow.cpp index 3a75cb28..11dce9bc 100644 --- a/src/documentwindow.cpp +++ b/src/documentwindow.cpp @@ -1820,11 +1820,11 @@ void DocumentWindow::showCutFaceSettingPopup(const QPoint &globalPos, std::setisEmpty()) - cutFaceTypeCount = (size_t)CutFace::UserDefined; + size_t cutFaceTypeCount = (size_t)CutFace::UserDefined; auto updateCutFaceButtonState = [&](size_t index) { + if (index != (int)CutFace::UserDefined) + cutFaceListWidget->selectCutFace(QUuid()); for (size_t i = 0; i < (size_t)cutFaceTypeCount; ++i) { auto button = buttons[i]; if (i == index) { @@ -1835,8 +1835,6 @@ void DocumentWindow::showCutFaceSettingPopup(const QPoint &globalPos, std::setsetEnabled(true); } } - if (index != (int)CutFace::UserDefined) - cutFaceListWidget->selectCutFace(QUuid()); }; cutFaceListWidget->enableMultipleSelection(false); diff --git a/src/partwidget.cpp b/src/partwidget.cpp index 13df4637..dd816609 100644 --- a/src/partwidget.cpp +++ b/src/partwidget.cpp @@ -558,11 +558,11 @@ void PartWidget::showCutRotationSettingPopup(const QPoint &pos) QPushButton *buttons[(int)CutFace::Count] = {0}; CutFaceListWidget *cutFaceListWidget = new CutFaceListWidget(m_document); - size_t cutFaceTypeCount = (size_t)CutFace::Count; - if (cutFaceListWidget->isEmpty()) - cutFaceTypeCount = (size_t)CutFace::UserDefined; + size_t cutFaceTypeCount = (size_t)CutFace::UserDefined; auto updateCutFaceButtonState = [&](size_t index) { + if (index != (int)CutFace::UserDefined) + cutFaceListWidget->selectCutFace(QUuid()); for (size_t i = 0; i < (size_t)cutFaceTypeCount; ++i) { auto button = buttons[i]; if (i == index) { @@ -573,8 +573,6 @@ void PartWidget::showCutRotationSettingPopup(const QPoint &pos) button->setEnabled(true); } } - if (index != (int)CutFace::UserDefined) - cutFaceListWidget->selectCutFace(QUuid()); }; cutFaceListWidget->enableMultipleSelection(false);