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 | 5ca40a44b93a3c2ebe35f115661bb867f5897eba (patch) | |
tree | 84f91ca7453ec89ef17c529e3f650822e3119eed | |
parent | b0dd198ea22bda19e03de8ad0daf58d385a55687 (diff) | |
download | scintilla-mirror-5ca40a44b93a3c2ebe35f115661bb867f5897eba.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; } //-------------------------------------------------------------------------------------------------- |