Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar Lakkimsetti2019-11-07 03:32:17 -0500
committerSravan Kumar Lakkimsetti2019-11-07 03:32:17 -0500
commite514dd11c31edb62256bfe104b1761af8a8c5464 (patch)
treeddffb064aa782c14bb00b9e679d7d1185ffd30c4
parentb093a533911a77b9e7a65c4991a051087f554d33 (diff)
downloadeclipse.platform.swt-e514dd11c31edb62256bfe104b1761af8a8c5464.tar.gz
eclipse.platform.swt-e514dd11c31edb62256bfe104b1761af8a8c5464.tar.xz
eclipse.platform.swt-e514dd11c31edb62256bfe104b1761af8a8c5464.zip
Bug 552148 - [hidpi][Cocoa] GC.copyArea(Image) broken since Bug 489451
Change-Id: I717378baddabb4b0cf1f631786b1c077f061eb64 Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
index cd4a279669..776536595a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -510,6 +510,7 @@ public void copyArea(Image image, int x, int y) {
try {
if (data.image != null) {
int srcX = x, srcY = y, destX = 0, destY = 0;
+ int scaleFactor = DPIUtil.getDeviceZoom () / 100;
NSSize srcSize = data.image.handle.size();
int imgHeight = (int)srcSize.height;
int destWidth = (int)srcSize.width - x, destHeight = (int)srcSize.height - y;
@@ -529,8 +530,8 @@ public void copyArea(Image image, int x, int y) {
NSRect destRect = new NSRect();
destRect.x = destX;
destRect.y = destY;
- destRect.width = destWidth;
- destRect.height = destHeight;
+ destRect.width = destWidth * scaleFactor;
+ destRect.height = destHeight * scaleFactor;
data.image.handle.drawInRect(destRect, srcRect, OS.NSCompositeCopy, 1);
NSGraphicsContext.static_restoreGraphicsState();
return;

Back to the top