diff options
author | nyamatongwe <nyamatongwe@gmail.com> | 2012-07-20 13:05:25 +1000 |
---|---|---|
committer | nyamatongwe <nyamatongwe@gmail.com> | 2012-07-20 13:05:25 +1000 |
commit | 6f05ff5985c3f96c08d968f90d1e786722545898 (patch) | |
tree | d16566341a69f6543ae376f53a292cc381c80147 | |
parent | 1656c853b764eb77c9419526c38eac9c681730a0 (diff) | |
download | scintilla-mirror-6f05ff5985c3f96c08d968f90d1e786722545898.tar.gz |
Fix text size on retina display by not scaling by device resolution.
-rw-r--r-- | cocoa/PlatCocoa.mm | 16 |
1 files 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; } //-------------------------------------------------------------------------------------------------- |