fromDPI function under macOS

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
taliadon
In need of some credit
In need of some credit
Posts: 3
Joined: Wed May 27, 2020 9:31 am

fromDPI function under macOS

Post by taliadon » Fri Jun 12, 2020 12:14 am

I'm currently developing an app within the MSW environment and using the 'wxSize fromDPI(wxSize)' function to handle DPI calculations, so when Windows scaling is set to 200% 'fromDPI(wxSize(32,32))' effectively returns a wxSize object where both x and y are set to 64. Whilst this seems to work flawlessly under windows, could somebody please confirm if this currently works under macOS (I currently don't have access to a mac)?

User avatar
doublemax
Moderator
Moderator
Posts: 14988
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: fromDPI function under macOS

Post by doublemax » Fri Jun 12, 2020 6:19 am

AFAIK OSX handles HiDPI totally different than Windows. On retina displays the app only "sees" logical screen coordinates that are smaller than the physical ones. Check what you get as screen size.
wxSystemSettings::GetMetric(wxSYS_SCREEN_X)
or
wxDisplay(0).GetGeometry().GetSize()
Use the source, Luke!

Post Reply