Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2012-11-07 18:27:35 +0000
committerSilenio Quarti2012-11-07 18:28:10 +0000
commite8a4ff64f73999309aaee295a952a7b40b119e25 (patch)
treeabe6357751104adbf13807a9fe0400efc5503eae
parentc9b7072fcf24fa735cb74dba234858010c98fbff (diff)
downloadeclipse.platform.swt-e8a4ff64f73999309aaee295a952a7b40b119e25.tar.gz
eclipse.platform.swt-e8a4ff64f73999309aaee295a952a7b40b119e25.tar.xz
eclipse.platform.swt-e8a4ff64f73999309aaee295a952a7b40b119e25.zip
Bug 383305 - [10.8]Font size incorrect when running in Retina - back port
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Device.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Device.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Device.java
index 43dff75607..3d9a60bd19 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Device.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Device.java
@@ -405,10 +405,15 @@ public FontData[] getFontList (String faceName, boolean scalable) {
}
Point getScreenDPI () {
- NSDictionary dictionary = getPrimaryScreen().deviceDescription();
+ NSScreen screen = getPrimaryScreen();
+ NSDictionary dictionary = screen.deviceDescription();
NSValue value = new NSValue(dictionary.objectForKey(new id(OS.NSDeviceResolution())).id);
NSSize size = value.sizeValue();
- return new Point((int)size.width, (int)size.height);
+ float /*double*/ scaling = 1;
+ if (OS.VERSION >= 0x1070) {
+ scaling = screen.backingScaleFactor();
+ }
+ return new Point((int)(size.width / scaling), (int)(size.height / scaling));
}
/**

Back to the top