diff --git a/src/slic3r/GUI/Gizmos/GLGizmoText.cpp b/src/slic3r/GUI/Gizmos/GLGizmoText.cpp index b5b408b445..d3f20dec0f 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoText.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoText.cpp @@ -255,10 +255,17 @@ void GLGizmoText::on_render_input_window(float x, float y, float bottom_limit) ImGui::SameLine(offset); bool add_clicked = m_imgui->button(_L("Add")); if (add_clicked) { + m_imgui->disabled_end(); + GizmoImguiEnd(); + ImGui::PopStyleVar(); + ImGuiWrapper::pop_toolbar_style(); + TriangleMesh mesh; load_text_shape(m_text, m_font_name.c_str(), m_font_size, m_thickness, m_bold, m_italic, mesh); ObjectList* obj_list = wxGetApp().obj_list(); obj_list->load_mesh_part(mesh, "text_shape"); + + return; } m_imgui->disabled_end(); diff --git a/src/slic3r/GUI/ImGuiWrapper.cpp b/src/slic3r/GUI/ImGuiWrapper.cpp index a07aae67aa..7f0a536072 100644 --- a/src/slic3r/GUI/ImGuiWrapper.cpp +++ b/src/slic3r/GUI/ImGuiWrapper.cpp @@ -2275,9 +2275,15 @@ void ImGuiWrapper::destroy_font() void ImGuiWrapper::destroy_fonts_texture() { if (m_font_another_texture != 0) { + if (m_new_frame_open) { + render(); + } init_font(true); glsafe(::glDeleteTextures(1, &m_font_another_texture)); m_font_another_texture = 0; + if (!m_new_frame_open) { + new_frame(); + } } }