diff options
author | tamasmeszaros <meszaros.q@gmail.com> | 2020-02-05 16:21:06 +0300 |
---|---|---|
committer | tamasmeszaros <meszaros.q@gmail.com> | 2020-02-05 16:21:06 +0300 |
commit | b0588abdd2e47d1e47a9715d3c2e3319cf7490db (patch) | |
tree | a3dc29704c8eed0a92e231635708f4e78e6b13a4 /src/slic3r/GUI/Gizmos | |
parent | a66dcf58f7c11fb358fb7f6d140c586a5202b981 (diff) |
Invalidate background process when HollowingGizmo modifies settings
Also, assertion fail in debug mode for m_selection
Diffstat (limited to 'src/slic3r/GUI/Gizmos')
-rw-r--r-- | src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp index e3b18792e..11a78fd60 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoHollow.cpp @@ -352,8 +352,9 @@ bool GLGizmoHollow::unproject_on_mesh(const Vec2d& mouse_pos, std::pair<Vec3f, V // of it and then remove the hole again. if (m_c->has_drilled_mesh()) { m_c->m_model_object->sla_drain_holes.push_back(sla::DrainHole()); + m_selected.push_back(false); m_parent.post_event(SimpleEvent(EVT_GLCANVAS_FORCE_UPDATE)); - wxGetApp().CallAfter([this] { m_c->m_model_object->sla_drain_holes.pop_back();}); + wxGetApp().CallAfter([this] { m_c->m_model_object->sla_drain_holes.pop_back(); m_selected.pop_back(); }); return false; } @@ -667,6 +668,7 @@ void GLGizmoHollow::on_render_input_window(float x, float y, float bottom_limit) bool first_run = true; // This is a hack to redraw the button when all points are removed, // so it is not delayed until the background process finishes. + RENDER_AGAIN: const float approx_height = m_imgui->scaled(20.0f); y = std::min(y, bottom_limit - approx_height); @@ -692,6 +694,8 @@ RENDER_AGAIN: if (m_imgui->button(m_desc["preview"])) hollow_mesh(); + + bool config_changed = false; ImGui::Separator(); @@ -701,6 +705,7 @@ RENDER_AGAIN: if (m_imgui->checkbox(m_desc["enable"], m_enable_hollowing)) { m_c->m_model_object->config.opt<ConfigOptionBool>("hollowing_enable", true)->value = m_enable_hollowing; wxGetApp().obj_list()->update_and_show_object_settings_item(); + config_changed = true; } } @@ -776,8 +781,10 @@ RENDER_AGAIN: m_c->m_model_object->config.opt<ConfigOptionFloat>("hollowing_min_thickness", true)->value = offset; m_c->m_model_object->config.opt<ConfigOptionFloat>("hollowing_quality", true)->value = quality; m_c->m_model_object->config.opt<ConfigOptionFloat>("hollowing_closing_distance", true)->value = closing_d; - if (slider_released) + if (slider_released) { wxGetApp().obj_list()->update_and_show_object_settings_item(); + config_changed = true; + } } m_imgui->disabled_end(); @@ -902,6 +909,9 @@ RENDER_AGAIN: if (force_refresh) m_parent.set_as_dirty(); + + if (config_changed) + m_parent.post_event(SimpleEvent(EVT_GLCANVAS_FORCE_UPDATE)); } bool GLGizmoHollow::on_is_activable() const |