mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-26 16:02:00 +08:00
fix a crash while deleting items too quickly for the gui.
This commit is contained in:
parent
29d393ec9c
commit
8dc9865867
@ -3685,15 +3685,17 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
|||||||
if (evt.LeftDown() && m_moving_enabled && m_mouse.drag.move_volume_idx == -1) {
|
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.
|
// Only accept the initial position, if it is inside the volume bounding box.
|
||||||
int volume_idx = get_first_hover_volume_idx();
|
int volume_idx = get_first_hover_volume_idx();
|
||||||
BoundingBoxf3 volume_bbox = m_volumes.volumes[volume_idx]->transformed_bounding_box();
|
if (m_volumes.volumes.size() > volume_idx) { //can fail if the screen takes a bit of time to refresh
|
||||||
volume_bbox.offset(1.0);
|
BoundingBoxf3 volume_bbox = m_volumes.volumes[volume_idx]->transformed_bounding_box();
|
||||||
if ((!any_gizmo_active || !evt.CmdDown()) && volume_bbox.contains(m_mouse.scene_position)) {
|
volume_bbox.offset(1.0);
|
||||||
m_volumes.volumes[volume_idx]->hover = GLVolume::HS_None;
|
if ((!any_gizmo_active || !evt.CmdDown()) && volume_bbox.contains(m_mouse.scene_position)) {
|
||||||
// The dragging operation is initiated.
|
m_volumes.volumes[volume_idx]->hover = GLVolume::HS_None;
|
||||||
m_mouse.drag.move_volume_idx = volume_idx;
|
// The dragging operation is initiated.
|
||||||
m_selection.start_dragging();
|
m_mouse.drag.move_volume_idx = volume_idx;
|
||||||
m_mouse.drag.start_position_3D = m_mouse.scene_position;
|
m_selection.start_dragging();
|
||||||
m_moving = true;
|
m_mouse.drag.start_position_3D = m_mouse.scene_position;
|
||||||
|
m_moving = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user