From 6f05ff5985c3f96c08d968f90d1e786722545898 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 20 Jul 2012 13:05:25 +1000 Subject: Fix text size on retina display by not scaling by device resolution. --- cocoa/PlatCocoa.mm | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 00380ffbc..d5cddb5b5 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -357,27 +357,23 @@ CGImageRef SurfaceImpl::GetImage() /** * Returns the vertical logical device resolution of the main monitor. + * This is no longer called. + * For Cocoa, all screens are treated as 72 DPI, even retina displays. */ int SurfaceImpl::LogPixelsY() { - if (verticalDeviceResolution == 0) - { - NSSize deviceResolution = [[[[NSScreen mainScreen] deviceDescription] - objectForKey: NSDeviceResolution] sizeValue]; - verticalDeviceResolution = (int) deviceResolution.height; - } - return verticalDeviceResolution; + return 72; } //-------------------------------------------------------------------------------------------------- /** - * Converts the logical font height (in dpi) into a pixel height for the current main screen. + * Converts the logical font height in points into a device height. + * For Cocoa, points are always used for the result even on retina displays. */ int SurfaceImpl::DeviceHeightFont(int points) { - int logPix = LogPixelsY(); - return (points * logPix + logPix / 2) / 72; + return points; } //-------------------------------------------------------------------------------------------------- -- cgit v1.2.3