From c963c3c80105f71b9a001e8c066cd7df9c14cadf Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 29 Sep 2021 12:35:53 +0200 Subject: [PATCH] Follow-up of 1a95169466614af21707f4928097af2d49f86403 - Fixed legend resizer --- src/slic3r/GUI/GCodeViewer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 0ab4f80d6..8897ffddf 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -3517,8 +3517,9 @@ void GCodeViewer::render_legend(float& legend_height) int old_view_type = static_cast(get_view_type()); int view_type = old_view_type; - ImGui::SetNextItemWidth(m_legend_resizer.dirty ? 0.0f : -1.0f); - if (m_legend_resizer.last_width > ImGui::GetWindowWidth()) + if (!m_legend_resizer.dirty) + ImGui::SetNextItemWidth(-1.0f); + if (m_legend_resizer.last_width >= ImGui::GetWindowWidth()) m_legend_resizer.dirty = false; ImGui::PushStyleColor(ImGuiCol_FrameBg, { 0.1f, 0.1f, 0.1f, 0.8f });