aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <nyamatongwe@gmail.com>2012-07-20 13:05:25 +1000
committernyamatongwe <nyamatongwe@gmail.com>2012-07-20 13:05:25 +1000
commit5ca40a44b93a3c2ebe35f115661bb867f5897eba (patch)
tree84f91ca7453ec89ef17c529e3f650822e3119eed
parentb0dd198ea22bda19e03de8ad0daf58d385a55687 (diff)
downloadscintilla-mirror-5ca40a44b93a3c2ebe35f115661bb867f5897eba.tar.gz
Fix text size on retina display by not scaling by device resolution.
-rw-r--r--cocoa/PlatCocoa.mm16
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;
}
//--------------------------------------------------------------------------------------------------