Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2012-11-07 18:27:35 +0000
committerSilenio Quarti2012-11-07 18:27:35 +0000
commit5e8905d741f00b44c8daeba6316e9407d9e100b9 (patch)
tree39707594184bbf48ee6fc2883b03b34296f66206
parentf41615cfa8c4f0b18c53f7774aa8e53205e1aef4 (diff)
downloadeclipse.platform.swt-5e8905d741f00b44c8daeba6316e9407d9e100b9.tar.gz
eclipse.platform.swt-5e8905d741f00b44c8daeba6316e9407d9e100b9.tar.xz
eclipse.platform.swt-5e8905d741f00b44c8daeba6316e9407d9e100b9.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