From f3968c5d99e51b9ef01e514833f9ccc4f0c5bbd4 Mon Sep 17 00:00:00 2001 From: "liz.li" Date: Fri, 18 Nov 2022 21:05:06 +0800 Subject: [PATCH] FIX: one_layer slider ,text doesn't display fully Change-Id: I9d02b246267bfd0eb74a1cea55dd769ea32da14a --- src/slic3r/GUI/IMSlider.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/IMSlider.cpp b/src/slic3r/GUI/IMSlider.cpp index 2a343bc95..e9e07d353 100644 --- a/src/slic3r/GUI/IMSlider.cpp +++ b/src/slic3r/GUI/IMSlider.cpp @@ -49,6 +49,7 @@ constexpr double miscalculation = scale_(scale_(1)); // equal to 1 mm2 static const float LEFT_MARGIN = 13.0f + 100.0f; // avoid thumbnail toolbar static const float SLIDER_LENGTH = 680.0f; static const float TEXT_WIDTH_DUMMY = 63.0f; +static const float ONE_LAYER_MARGIN = 20.0f; static const ImVec2 ONE_LAYER_OFFSET = ImVec2(41.0f, 44.0f); static const ImVec2 HORIZONTAL_SLIDER_SIZE = ImVec2(764.0f, 90.0f);//764 = 680 + handle_dummy_width * 2 + text_right_dummy static const ImVec2 VERTICAL_SLIDER_SIZE = ImVec2(105.0f, 748.0f);//748 = 680 + text_dummy_height * 2 @@ -1238,9 +1239,9 @@ bool IMSlider::render(int canvas_width, int canvas_height) } imgui.end(); } else { - float pos_x = canvas_width - (VERTICAL_SLIDER_SIZE.x + TEXT_WIDTH_DUMMY * scale - TEXT_WIDTH_DUMMY) * m_scale; + float pos_x = canvas_width - (VERTICAL_SLIDER_SIZE.x + TEXT_WIDTH_DUMMY * scale - TEXT_WIDTH_DUMMY + ONE_LAYER_MARGIN) * m_scale; float pos_y = std::max(ONE_LAYER_OFFSET.y, 0.15f * canvas_height - (VERTICAL_SLIDER_SIZE.y - SLIDER_LENGTH) * scale); - ImVec2 size = ImVec2((VERTICAL_SLIDER_SIZE.x + TEXT_WIDTH_DUMMY * scale - TEXT_WIDTH_DUMMY) * m_scale, canvas_height - 2 * pos_y); + ImVec2 size = ImVec2((VERTICAL_SLIDER_SIZE.x + TEXT_WIDTH_DUMMY * scale - TEXT_WIDTH_DUMMY + ONE_LAYER_MARGIN) * m_scale, canvas_height - 2 * pos_y); imgui.set_next_window_pos(pos_x, pos_y, ImGuiCond_Always); imgui.begin(std::string("laysers_slider"), windows_flag);