Fixed a crash when using a selection rectangle in cut gizmo

This commit is contained in:
Lukas Matena 2022-05-13 15:43:21 +02:00
parent 374cb237ed
commit d557bd1dd3

View file

@ -6419,12 +6419,13 @@ bool GLCanvas3D::_is_any_volume_outside() const
void GLCanvas3D::_update_selection_from_hover()
{
bool ctrl_pressed = wxGetKeyState(WXK_CONTROL);
bool selection_changed = false;
if (m_hover_volume_idxs.empty()) {
if (!ctrl_pressed && (m_rectangle_selection.get_state() == GLSelectionRectangle::Select))
if (!ctrl_pressed && (m_rectangle_selection.get_state() == GLSelectionRectangle::Select)) {
selection_changed = ! m_selection.is_empty();
m_selection.remove_all();
return;
}
}
GLSelectionRectangle::EState state = m_rectangle_selection.get_state();
@ -6437,7 +6438,6 @@ void GLCanvas3D::_update_selection_from_hover()
}
}
bool selection_changed = false;
if (state == GLSelectionRectangle::Select) {
bool contains_all = true;
for (int i : m_hover_volume_idxs) {