From 0c2956be091f1040314a48181333e530dc50ebe8 Mon Sep 17 00:00:00 2001 From: Stefan Ziegler Date: Mon, 10 Dec 2018 10:47:56 +0100 Subject: [PATCH] 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. --- docs/changes.txt | 8 ++++++++ src/common/bmpbtncmn.cpp | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index ea37991c44..fd1b14acb7 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -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) ---------------------------- diff --git a/src/common/bmpbtncmn.cpp b/src/common/bmpbtncmn.cpp index ff2ea043ce..039f977c54 100644 --- a/src/common/bmpbtncmn.cpp +++ b/src/common/bmpbtncmn.cpp @@ -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; }