summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti <silenio_quarti@ca.ibm.com>2012-11-07 12:45:35 -0500
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2012-11-07 12:45:35 -0500
commit5148ba36d3ddf0aa6ecd7c6a53403a3b5cb005ee (patch)
tree495478caaa23d147ae414b3caf9e0d2bcb89a760
parentcef8e2d081451feb96347626daa1e4855446d6e2 (diff)
downloadeclipse.platform.swt-5148ba36d3ddf0aa6ecd7c6a53403a3b5cb005ee.tar.gz
eclipse.platform.swt-5148ba36d3ddf0aa6ecd7c6a53403a3b5cb005ee.tar.xz
eclipse.platform.swt-5148ba36d3ddf0aa6ecd7c6a53403a3b5cb005ee.zip
Bug 383305 - [10.8]Font size incorrect when running in Retina
-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 986ef93fbf..f7cc540a53 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);
+ double /*float*/ scaling = 1;
+ if (OS.VERSION >= 0x1070) {
+ scaling = screen.backingScaleFactor();
+ }
+ return new Point((int)(size.width / scaling), (int)(size.height / scaling));
}
/**