X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c944835aaad14d090837aae9a14d78c08f7df512..a66bf817a6ba833ad47cefc9fa8948ef8045a59d:/src/osx/core/bitmap.cpp diff --git a/src/osx/core/bitmap.cpp b/src/osx/core/bitmap.cpp index bf31f8a00c..ac0804d1f1 100644 --- a/src/osx/core/bitmap.cpp +++ b/src/osx/core/bitmap.cpp @@ -1851,9 +1851,23 @@ bool wxBundleResourceHandler::LoadFile(wxBitmap *bitmap, { wxString ext = GetExtension().Lower(); wxCFStringRef resname(name); + wxCFStringRef resname2x(name+"@2x"); wxCFStringRef restype(ext); + double scale = 1.0; - wxCFRef imageURL(CFBundleCopyResourceURL(CFBundleGetMainBundle(), resname, restype, NULL)); + wxCFRef imageURL; + + if ( wxOSXGetMainScreenContentScaleFactor() > 1.9 ) + { + imageURL.reset(CFBundleCopyResourceURL(CFBundleGetMainBundle(), resname2x, restype, NULL)); + scale = 2.0; + } + + if ( imageURL.get() == NULL ) + { + imageURL.reset(CFBundleCopyResourceURL(CFBundleGetMainBundle(), resname, restype, NULL)); + scale = 1.0; + } if ( imageURL.get() != NULL ) { @@ -1869,7 +1883,7 @@ bool wxBundleResourceHandler::LoadFile(wxBitmap *bitmap, kCGRenderingIntentDefault); if ( image != NULL ) { - bitmap->Create(image); + bitmap->Create(image,scale); CGImageRelease(image); } }