fix a crash while deleting items too quickly for the gui.

This commit is contained in:
supermerill 2020-11-22 03:26:04 +01:00
parent 29d393ec9c
commit 8dc9865867

View File

@ -3685,6 +3685,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
if (evt.LeftDown() && m_moving_enabled && m_mouse.drag.move_volume_idx == -1) {
// Only accept the initial position, if it is inside the volume bounding box.
int volume_idx = get_first_hover_volume_idx();
if (m_volumes.volumes.size() > volume_idx) { //can fail if the screen takes a bit of time to refresh
BoundingBoxf3 volume_bbox = m_volumes.volumes[volume_idx]->transformed_bounding_box();
volume_bbox.offset(1.0);
if ((!any_gizmo_active || !evt.CmdDown()) && volume_bbox.contains(m_mouse.scene_position)) {
@ -3699,6 +3700,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
}
}
}
}
else if (evt.Dragging() && evt.LeftIsDown() && m_layers_editing.state == LayersEditing::Unknown && m_mouse.drag.move_volume_idx != -1) {
if (!m_mouse.drag.move_requires_threshold) {
m_mouse.dragging = true;