Fix size of wxImageList created by wxBitmapBundle

The size must be specified in logical, and not physical, pixels and the
failure to do use the correct units results in a silent (!) failure to
add any bitmaps to the wxImageList later.
This commit is contained in:
Vadim Zeitlin 2021-11-07 23:23:47 +01:00
parent 73886b1bb2
commit 0588bc8820

View File

@ -570,8 +570,11 @@ wxBitmapBundle::CreateImageList(wxWindow* win,
// we do here. Note that this size is only used to break the tie in case
// the same number of bundles prefer two different sizes, so it's not going
// to matter at all in most cases.
const wxSize
size = GetConsensusSizeFor(win, bundles, bundles[0].GetDefaultSize());
wxSize size = GetConsensusSizeFor(win, bundles, bundles[0].GetDefaultSize());
// wxImageList wants the logical size for the platforms where logical and
// physical pixels are different.
size /= win->GetContentScaleFactor();
wxImageList* const iml = new wxImageList(size.x, size.y);