Gizmo Measure - Use [Delete] key in place of Shift+Right mouse to restart selection

This commit is contained in:
enricoturri1966 2022-11-21 09:13:28 +01:00
parent 5d6346f275
commit 543950bf4b
2 changed files with 7 additions and 8 deletions

View file

@ -401,12 +401,6 @@ bool GLGizmoMeasure::on_mouse(const wxMouseEvent &mouse_event)
if ((m_mode != EMode::CenterSelection && mouse_event.CmdDown()) || (m_mode == EMode::CenterSelection && m_hover_id != SELECTION_1_ID && m_hover_id != SELECTION_2_ID)) {
return false;
}
if (mouse_event.ShiftDown()) {
m_selected_features.reset();
m_selection_raycasters.clear();
m_parent.request_extra_frame();
}
}
else if (mouse_event.Leaving())
m_mouse_left_down = false;
@ -477,6 +471,11 @@ bool GLGizmoMeasure::gizmo_event(SLAGizmoEventType action, const Vec2d& mouse_po
m_mode = control_down ? EMode::PointSelection : EMode::FeatureSelection;
restore_scene_raycasters_state();
}
else if (action == SLAGizmoEventType::Delete) {
m_selected_features.reset();
m_selection_raycasters.clear();
m_parent.request_extra_frame();
}
return true;
}
@ -1738,7 +1737,7 @@ void GLGizmoMeasure::on_render_input_window(float x, float y, float bottom_limit
}
if (m_selected_features.first.feature.has_value()) {
add_strings_row_to_table(*m_imgui, _u8L("Shift") + "+" + _u8L("Right mouse button"), ImGuiWrapper::COL_ORANGE_LIGHT, _u8L("Restart selection"), ImGui::GetStyleColorVec4(ImGuiCol_Text));
add_strings_row_to_table(*m_imgui, _u8L("Delete"), ImGuiWrapper::COL_ORANGE_LIGHT, _u8L("Restart selection"), ImGui::GetStyleColorVec4(ImGuiCol_Text));
++row_count;
}

View file

@ -554,7 +554,7 @@ bool GLGizmosManager::on_char(wxKeyEvent& evt)
case WXK_BACK:
case WXK_DELETE:
{
if ((m_current == SlaSupports || m_current == Hollow || m_current == Cut) && gizmo_event(SLAGizmoEventType::Delete))
if ((m_current == SlaSupports || m_current == Hollow || m_current == Cut || m_current == Measure) && gizmo_event(SLAGizmoEventType::Delete))
processed = true;
break;