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:
committed by
Vadim Zeitlin
parent
8ec8a0cf66
commit
0c2956be09
@@ -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)
|
||||
----------------------------
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user