Fix wxInfoBar close button size in high DPI

Don't apply the scaling factor twice when dynamically creating the close
button bitmap.

Closes https://github.com/wxWidgets/wxWidgets/pull/1063

Closes #18283.
This commit is contained in:
Stefan Ziegler
2018-12-10 10:47:56 +01:00
committed by Vadim Zeitlin
parent 8ec8a0cf66
commit 0c2956be09
2 changed files with 11 additions and 3 deletions

View File

@@ -102,6 +102,14 @@ Changes in behaviour which may result in build errors
removing its name.
3.1.3: (released 2019-??-??)
----------------------------
All (GUI):
- Fix wxInfoBar close button size in high DPI (Stefan Ziegler).
3.1.2: (released 2018-12-10)
----------------------------

View File

@@ -103,13 +103,13 @@ GetCloseButtonBitmap(wxWindow *win,
const wxColour& colBg,
int flags = 0)
{
// size is physical here because it comes from wxArtProvider::GetSizeHint
wxBitmap bmp;
bmp.CreateScaled(size.x, size.y, wxBITMAP_SCREEN_DEPTH, win->GetContentScaleFactor());
bmp.Create(size.x, size.y, wxBITMAP_SCREEN_DEPTH);
wxMemoryDC dc(bmp);
dc.SetBackground(colBg);
dc.Clear();
wxRendererNative::Get().
DrawTitleBarBitmap(win, dc, win->FromDIP(size), wxTITLEBAR_BUTTON_CLOSE, flags);
wxRendererNative::Get().DrawTitleBarBitmap(win, dc, size, wxTITLEBAR_BUTTON_CLOSE, flags);
return bmp;
}