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.
This commit is contained in:
Tobias Taschner
2015-09-25 15:40:51 +02:00
parent e0cb697991
commit d4a2f1578a

View File

@@ -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;
}