mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-19 22:14:27 +08:00
Fix: Do not revert changes on change GLGizmoBase::m_state when apply was used
This commit is contained in:
parent
af413e37bb
commit
9f70afe44e
@ -199,7 +199,7 @@ void GLGizmoSimplify::on_render_input_window(float x, float y, float bottom_limi
|
|||||||
ImGui::SameLine(m_gui_cfg->bottom_left_width);
|
ImGui::SameLine(m_gui_cfg->bottom_left_width);
|
||||||
if (m_imgui->button(_L("Preview"))) {
|
if (m_imgui->button(_L("Preview"))) {
|
||||||
m_state = State::preview;
|
m_state = State::preview;
|
||||||
// simplify but not aply on mesh
|
// simplify but not apply on mesh
|
||||||
process();
|
process();
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
@ -207,13 +207,10 @@ void GLGizmoSimplify::on_render_input_window(float x, float y, float bottom_limi
|
|||||||
if (!m_is_valid_result) {
|
if (!m_is_valid_result) {
|
||||||
m_state = State::close_on_end;
|
m_state = State::close_on_end;
|
||||||
process();
|
process();
|
||||||
} else {
|
} else if (m_exist_preview) {
|
||||||
// use preview and close
|
// use preview and close
|
||||||
if (m_exist_preview) {
|
after_apply();
|
||||||
// fix hollowing, sla support points, modifiers, ...
|
} else { // no changes made
|
||||||
auto plater = wxGetApp().plater();
|
|
||||||
plater->changed_mesh(m_obj_index);
|
|
||||||
}
|
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -237,18 +234,22 @@ void GLGizmoSimplify::on_render_input_window(float x, float y, float bottom_limi
|
|||||||
m_parent.reload_scene(true);
|
m_parent.reload_scene(true);
|
||||||
// set m_state must be before close() !!!
|
// set m_state must be before close() !!!
|
||||||
m_state = State::settings;
|
m_state = State::settings;
|
||||||
if (close_on_end) {
|
if (close_on_end) after_apply();
|
||||||
// fix hollowing, sla support points, modifiers, ...
|
|
||||||
auto plater = wxGetApp().plater();
|
|
||||||
plater->changed_mesh(m_obj_index);
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fix warning icon in object list
|
// Fix warning icon in object list
|
||||||
wxGetApp().obj_list()->update_item_error_icon(m_obj_index, -1);
|
wxGetApp().obj_list()->update_item_error_icon(m_obj_index, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GLGizmoSimplify::after_apply() {
|
||||||
|
// set flag to NOT revert changes when switch GLGizmoBase::m_state
|
||||||
|
m_exist_preview = false;
|
||||||
|
// fix hollowing, sla support points, modifiers, ...
|
||||||
|
auto plater = wxGetApp().plater();
|
||||||
|
plater->changed_mesh(m_obj_index);
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
|
||||||
void GLGizmoSimplify::close() {
|
void GLGizmoSimplify::close() {
|
||||||
// close gizmo == open it again
|
// close gizmo == open it again
|
||||||
GLGizmosManager &gizmos_mgr = m_parent.get_gizmos_manager();
|
GLGizmosManager &gizmos_mgr = m_parent.get_gizmos_manager();
|
||||||
|
@ -32,6 +32,7 @@ protected:
|
|||||||
virtual void on_set_state() override;
|
virtual void on_set_state() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void after_apply();
|
||||||
void close();
|
void close();
|
||||||
void process();
|
void process();
|
||||||
void set_its(indexed_triangle_set &its);
|
void set_its(indexed_triangle_set &its);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user