From 3981e25f7511a4792db9748f58513227208a5c38 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Thu, 6 Feb 2020 12:06:39 +0100 Subject: [PATCH] Fixed labels auto-sizing --- src/slic3r/GUI/GLCanvas3D.cpp | 3 +-- src/slic3r/GUI/GUI_ObjectList.cpp | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index a88dbec49..4096e99c4 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1362,8 +1362,7 @@ void GLCanvas3D::Labels::render(const std::vector& sorted_ } // force re-render while the windows gets to its final size (it takes several frames) - float content_w = 1 + ImGui::GetWindowContentRegionWidth(); - if (content_w < label_len) + if (ImGui::GetWindowContentRegionWidth() + 2.0f * ImGui::GetStyle().WindowPadding.x != ImGui::CalcWindowExpectedSize(ImGui::GetCurrentWindow()).x) m_canvas.request_extra_frame(); imgui.end(); diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index d630f152f..c07d50a0e 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -3905,6 +3905,8 @@ void ObjectList::OnEditingDone(wxDataViewEvent &event) // Here the last active column is forgotten, so when leaving the editing mode, the next mouse click will not enter the editing mode of the newly selected column. m_last_selected_column = -1; #endif //__WXMSW__ + + wxGetApp().plater()->set_current_canvas_as_dirty(); } void ObjectList::show_multi_selection_menu()