Close quad point popup when selected quad or quad index invalid

This commit is contained in:
Robert Müller 2023-07-08 11:40:43 +02:00
parent 2cc03a1444
commit fa65e19c5d

View file

@ -1199,6 +1199,8 @@ CUI::EPopupMenuFunctionResult CEditor::PopupPoint(void *pContext, CUIRect View,
{ {
CEditor *pEditor = static_cast<CEditor *>(pContext); CEditor *pEditor = static_cast<CEditor *>(pContext);
std::vector<CQuad *> vpQuads = pEditor->GetSelectedQuads(); std::vector<CQuad *> vpQuads = pEditor->GetSelectedQuads();
if(!in_range<int>(pEditor->m_SelectedQuadIndex, 0, vpQuads.size() - 1))
return CUI::POPUP_CLOSE_CURRENT;
CQuad *pCurrentQuad = vpQuads[pEditor->m_SelectedQuadIndex]; CQuad *pCurrentQuad = vpQuads[pEditor->m_SelectedQuadIndex];
enum enum