From 7553bbe12dadbacf683b7a28fdad722d8dcb2fa7 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Mon, 6 Nov 2023 10:03:02 +0100 Subject: [PATCH] DropDown: OSX specific: Fixed rendering of selected item --- src/slic3r/GUI/Widgets/DropDown.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Widgets/DropDown.cpp b/src/slic3r/GUI/Widgets/DropDown.cpp index 6eccc07e35..cacb39fcd6 100644 --- a/src/slic3r/GUI/Widgets/DropDown.cpp +++ b/src/slic3r/GUI/Widgets/DropDown.cpp @@ -291,9 +291,11 @@ void DropDown::render(wxDC &dc) // if (GetWindowStyle() & wxBORDER_NONE) // dc.SetPen(wxNullPen); + const bool is_retina = wxOSX && dc.GetContentScaleFactor() > 1.0; + wxRect rc(0, 0, size.x, size.y); - if (wxOSX && dc.GetContentScaleFactor() > 1.0) - // On Retina displays all controls are cut on 1px + // On Retina displays all controls are cut on 1px + if (is_retina) rc.x = rc.y = 1; // draw background @@ -329,8 +331,12 @@ void DropDown::render(wxDC &dc) dc.SetBrush(wxBrush(selector_background_color.colorForStates(StateColor::Disabled))); dc.SetPen(wxPen(selector_background_color.colorForStates(states))); rcContent.Deflate(4, 1); + if (is_retina) + rc.y += 1; dc.DrawRectangle(rcContent); rcContent.Inflate(4, 1); + if (is_retina) + rc.y -= 1; } rcContent.y = offset.y; }