FIX: dailytips window and gcodeviwer legend window size issue

reset to original logic of dailytips and legend window size

jira: new

Change-Id: Iacb016bb222ba3f87317cfbe1f2b003802d773a5
This commit is contained in:
liz.li 2023-11-07 15:57:02 +08:00 committed by Lane.Wei
parent 6e595f251c
commit e46f0cace5
2 changed files with 20 additions and 12 deletions

View file

@ -4420,7 +4420,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv
ImGui::PushStyleColor(ImGuiCol_ScrollbarGrabHovered, ImVec4(0.93f, 0.93f, 0.93f, 1.00f));
ImGui::PushStyleColor(ImGuiCol_ScrollbarGrabActive, ImVec4(0.93f, 0.93f, 0.93f, 1.00f));
ImGui::SetNextWindowBgAlpha(0.8f);
const float max_height = 0.45f * static_cast<float>(cnv_size.get_height());
const float max_height = 0.75f * static_cast<float>(cnv_size.get_height());
const float child_height = 0.3333f * max_height;
ImGui::SetNextWindowSizeConstraints({ 0.0f, 0.0f }, { -1.0f, max_height });
imgui.begin(std::string("Legend"), ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove);