using GetPreferredSizeAtScale when assembling native NSImage from a bitmap bundle
This commit is contained in:
@@ -249,12 +249,14 @@ WXImage wxOSXGetImageFromBundle(const wxBitmapBundle& bundle)
|
|||||||
wxBitmap bmp = const_cast<wxBitmapBundleImpl*>(impl)->GetBitmap(sz);
|
wxBitmap bmp = const_cast<wxBitmapBundleImpl*>(impl)->GetBitmap(sz);
|
||||||
image = wxOSXImageFromBitmap(bmp);
|
image = wxOSXImageFromBitmap(bmp);
|
||||||
|
|
||||||
// unconditionally try to add a 2x version
|
// unconditionally try to add a 2x version, if there really is a different one
|
||||||
double scale = 2.0;
|
wxSize doublesz = impl->GetPreferredSizeAtScale(2.0);
|
||||||
wxSize doublesz = sz * scale;
|
if ( doublesz != sz )
|
||||||
|
{
|
||||||
bmp = const_cast<wxBitmapBundleImpl*>(impl)->GetBitmap(doublesz);
|
bmp = const_cast<wxBitmapBundleImpl*>(impl)->GetBitmap(doublesz);
|
||||||
if ( bmp.IsOk() && bmp.GetSize() != sz )
|
if ( bmp.IsOk() )
|
||||||
wxOSXAddBitmapToImage(image, bmp);
|
wxOSXAddBitmapToImage(image, bmp);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
double scale = wxOSXGetMainScreenContentScaleFactor();
|
double scale = wxOSXGetMainScreenContentScaleFactor();
|
||||||
wxSize scaledSize = sz * scale;
|
wxSize scaledSize = sz * scale;
|
||||||
|
Reference in New Issue
Block a user