From 9f30ea535a84b8dc94925a0c8c980fbf84a0cc49 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Fri, 20 Nov 2020 17:23:35 +0100 Subject: [PATCH] Windows specific: Fixed layout of fields inside the OG_CustomCtrl --- src/slic3r/GUI/OG_CustomCtrl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/slic3r/GUI/OG_CustomCtrl.cpp b/src/slic3r/GUI/OG_CustomCtrl.cpp index 30c7e76e4..2ed1ea252 100644 --- a/src/slic3r/GUI/OG_CustomCtrl.cpp +++ b/src/slic3r/GUI/OG_CustomCtrl.cpp @@ -174,7 +174,15 @@ wxPoint OG_CustomCtrl::get_pos(const Line& line, Field* field_in/* = nullptr*/) label += ":"; wxCoord label_w, label_h; +#ifdef __WXMSW__ + // when we use 2 monitors with different DPIs, GetTextExtent() return value for the primary display + // so, use dc.GetMultiLineTextExtent on Windows + wxPaintDC dc(this); + dc.SetFont(m_font); + dc.GetMultiLineTextExtent(label, &label_w, &label_h); +#else GetTextExtent(label, &label_w, &label_h, 0, 0, &m_font); +#endif //__WXMSW__ h_pos += label_w + 1 + m_h_gap; } h_pos += (opt.opt.gui_type == "legend" ? 1 : 3) * blinking_button_width;