mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 18:58:00 -06:00
SLA gizmo clipping plane resetting
Clipping plane direction is now initialized when the plane is first moved, not when the gizmo is opened. This is how previous versions worked. This is a minimal-effort solution before the clipping plane is refactored properly.
This commit is contained in:
parent
4df6a645f2
commit
4c22023762
4 changed files with 40 additions and 15 deletions
|
@ -71,7 +71,7 @@ void GLGizmoSlaSupports::set_sla_support_data(ModelObject* model_object, const S
|
|||
if (m_state == On)
|
||||
m_c->build_AABB_if_needed();
|
||||
|
||||
update_clipping_plane();
|
||||
update_clipping_plane(m_c->m_clipping_plane_was_moved);
|
||||
|
||||
if (m_state == On) {
|
||||
m_parent.toggle_model_objects_visibility(false);
|
||||
|
@ -599,7 +599,8 @@ bool GLGizmoSlaSupports::gizmo_event(SLAGizmoEventType action, const Vec2d& mous
|
|||
|
||||
if (action == SLAGizmoEventType::MouseWheelUp && control_down) {
|
||||
m_c->m_clipping_plane_distance = std::min(1.f, m_c->m_clipping_plane_distance + 0.01f);
|
||||
update_clipping_plane(true);
|
||||
update_clipping_plane(m_c->m_clipping_plane_was_moved);
|
||||
m_c->m_clipping_plane_was_moved = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -925,8 +926,10 @@ RENDER_AGAIN:
|
|||
|
||||
ImGui::SameLine(clipping_slider_left);
|
||||
ImGui::PushItemWidth(window_width - clipping_slider_left);
|
||||
if (ImGui::SliderFloat(" ", &m_c->m_clipping_plane_distance, 0.f, 1.f, "%.2f"))
|
||||
update_clipping_plane(true);
|
||||
if (ImGui::SliderFloat(" ", &m_c->m_clipping_plane_distance, 0.f, 1.f, "%.2f")) {
|
||||
update_clipping_plane(m_c->m_clipping_plane_was_moved);
|
||||
m_c->m_clipping_plane_was_moved = true;
|
||||
}
|
||||
|
||||
|
||||
if (m_imgui->button("?")) {
|
||||
|
@ -1011,7 +1014,7 @@ void GLGizmoSlaSupports::on_set_state()
|
|||
Plater::TakeSnapshot snapshot(wxGetApp().plater(), _(L("SLA gizmo turned on")));
|
||||
|
||||
m_c->unstash_clipping_plane();
|
||||
update_clipping_plane(m_c->m_clipping_plane_distance != 0.f);
|
||||
update_clipping_plane(m_c->m_clipping_plane_was_moved);
|
||||
|
||||
m_c->build_AABB_if_needed();
|
||||
|
||||
|
@ -1021,9 +1024,10 @@ void GLGizmoSlaSupports::on_set_state()
|
|||
reload_cache();
|
||||
|
||||
m_parent.toggle_model_objects_visibility(false);
|
||||
if (m_c->m_model_object /*&& ! m_c->m_cavity_mesh*/)
|
||||
if (m_c->m_model_object) {
|
||||
m_parent.toggle_model_objects_visibility(true, m_c->m_model_object, m_c->m_active_instance);
|
||||
m_parent.toggle_sla_auxiliaries_visibility(! m_editing_mode, m_c->m_model_object, m_c->m_active_instance);
|
||||
m_parent.toggle_sla_auxiliaries_visibility(! m_editing_mode, m_c->m_model_object, m_c->m_active_instance);
|
||||
}
|
||||
|
||||
// Set default head diameter from config.
|
||||
const DynamicPrintConfig& cfg = wxGetApp().preset_bundle->sla_prints.get_edited_preset().config;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue