From d4a2f1578a4bf6a41d82f65ab91166d8f0d7bf44 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Fri, 25 Sep 2015 15:40:51 +0200 Subject: [PATCH] Handle high resolution displays in wxBitmapButtonBase::NewCloseButton(). Bitmap for the close button is scaled based on GetContentScaleFactor(). On OS X the resulting bitmap has to use the correct scaling factor in order to be displayed correctly on the button when using a high resolution display. --- src/common/bmpbtncmn.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/bmpbtncmn.cpp b/src/common/bmpbtncmn.cpp index cdedb2861a..ff2ea043ce 100644 --- a/src/common/bmpbtncmn.cpp +++ b/src/common/bmpbtncmn.cpp @@ -103,12 +103,13 @@ GetCloseButtonBitmap(wxWindow *win, const wxColour& colBg, int flags = 0) { - wxBitmap bmp(size); + wxBitmap bmp; + bmp.CreateScaled(size.x, size.y, wxBITMAP_SCREEN_DEPTH, win->GetContentScaleFactor()); wxMemoryDC dc(bmp); dc.SetBackground(colBg); dc.Clear(); wxRendererNative::Get(). - DrawTitleBarBitmap(win, dc, size, wxTITLEBAR_BUTTON_CLOSE, flags); + DrawTitleBarBitmap(win, dc, win->FromDIP(size), wxTITLEBAR_BUTTON_CLOSE, flags); return bmp; }