Gizmo Measure - Fixed loss of selection when panning the view

This commit is contained in:
enricoturri1966 2022-11-07 14:15:36 +01:00
parent 380c746871
commit 236f97aded
2 changed files with 6 additions and 3 deletions

View File

@ -3696,7 +3696,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
// if right clicking on volume, propagate event through callback (shows context menu) // if right clicking on volume, propagate event through callback (shows context menu)
int volume_idx = get_first_hover_volume_idx(); int volume_idx = get_first_hover_volume_idx();
if (!m_volumes.volumes[volume_idx]->is_wipe_tower // no context menu for the wipe tower if (!m_volumes.volumes[volume_idx]->is_wipe_tower // no context menu for the wipe tower
&& m_gizmos.get_current_type() != GLGizmosManager::SlaSupports) // disable context menu when the gizmo is open && (m_gizmos.get_current_type() != GLGizmosManager::SlaSupports && m_gizmos.get_current_type() != GLGizmosManager::Measure)) // disable context menu when the gizmo is open
{ {
// forces the selection of the volume // forces the selection of the volume
/* m_selection.add(volume_idx); // #et_FIXME_if_needed /* m_selection.add(volume_idx); // #et_FIXME_if_needed
@ -3720,7 +3720,8 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
if (!m_mouse.dragging) { if (!m_mouse.dragging) {
// do not post the event if the user is panning the scene // do not post the event if the user is panning the scene
// or if right click was done over the wipe tower // or if right click was done over the wipe tower
const bool post_right_click_event = m_hover_volume_idxs.empty() || !m_volumes.volumes[get_first_hover_volume_idx()]->is_wipe_tower; const bool post_right_click_event = (m_hover_volume_idxs.empty() || !m_volumes.volumes[get_first_hover_volume_idx()]->is_wipe_tower) &&
m_gizmos.get_current_type() != GLGizmosManager::Measure;
if (post_right_click_event) if (post_right_click_event)
post_event(RBtnEvent(EVT_GLCANVAS_RIGHT_CLICK, { logical_pos, m_hover_volume_idxs.empty() })); post_event(RBtnEvent(EVT_GLCANVAS_RIGHT_CLICK, { logical_pos, m_hover_volume_idxs.empty() }));
} }

View File

@ -306,6 +306,8 @@ bool GLGizmoMeasure::on_mouse(const wxMouseEvent &mouse_event)
m_measurement_result.transform(m_volume_matrix); m_measurement_result.transform(m_volume_matrix);
} }
m_imgui->set_requires_extra_frame();
return true; return true;
} }
@ -327,7 +329,7 @@ bool GLGizmoMeasure::on_mouse(const wxMouseEvent &mouse_event)
else if (mouse_event.RightDown() && mouse_event.CmdDown()) { else if (mouse_event.RightDown() && mouse_event.CmdDown()) {
m_selected_features.reset(); m_selected_features.reset();
m_selection_raycasters.clear(); m_selection_raycasters.clear();
m_imgui->set_requires_extra_frame(); m_parent.request_extra_frame();
} }
else if (mouse_event.Leaving()) else if (mouse_event.Leaving())
m_mouse_left_down = false; m_mouse_left_down = false;