Follow-up of 1a95169466 - Fixed legend resizer

This commit is contained in:
enricoturri1966 2021-09-29 12:35:53 +02:00
parent 1a95169466
commit c963c3c801

View File

@ -3517,8 +3517,9 @@ void GCodeViewer::render_legend(float& legend_height)
int old_view_type = static_cast<int>(get_view_type()); int old_view_type = static_cast<int>(get_view_type());
int view_type = old_view_type; int view_type = old_view_type;
ImGui::SetNextItemWidth(m_legend_resizer.dirty ? 0.0f : -1.0f); if (!m_legend_resizer.dirty)
if (m_legend_resizer.last_width > ImGui::GetWindowWidth()) ImGui::SetNextItemWidth(-1.0f);
if (m_legend_resizer.last_width >= ImGui::GetWindowWidth())
m_legend_resizer.dirty = false; m_legend_resizer.dirty = false;
ImGui::PushStyleColor(ImGuiCol_FrameBg, { 0.1f, 0.1f, 0.1f, 0.8f }); ImGui::PushStyleColor(ImGuiCol_FrameBg, { 0.1f, 0.1f, 0.1f, 0.8f });