Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLakshmi Shanmugam2018-02-01 07:41:43 -0500
committerLakshmi Shanmugam2018-12-26 03:54:45 -0500
commit0651ec1691e9f2a9fe74cac146ff9412f893d981 (patch)
tree75db24d3372c42f8ac73ea4a864a1b1cf669b108
parent1eea9137b08605701777b122d446fa41014e1464 (diff)
downloadeclipse.platform.swt-0651ec1691e9f2a9fe74cac146ff9412f893d981.tar.gz
eclipse.platform.swt-0651ec1691e9f2a9fe74cac146ff9412f893d981.tar.xz
eclipse.platform.swt-0651ec1691e9f2a9fe74cac146ff9412f893d981.zip
Bug 515094: [cocoa][hidpi] Image(Device, Image, int) constructor doesn't
retain drawings on top of *provider image Added check to fix AIOBE. Change-Id: I0303a4850603f0027430a07808466202496ca861 Signed-off-by: Lakshmi Shanmugam <lshanmug@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java
index 0290622cad..d0ccede5ed 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java
@@ -968,7 +968,7 @@ void createAlpha () {
long /*int*/ width = imageRep.pixelsWide();
int offset = 0, alphaOffset = (format & OS.NSAlphaFirstBitmapFormat) != 0 ? 0 : 3;
for (int y = 0; y<height; y++) {
- for (int x = 0; x<width; x++) {
+ for (int x = 0; x<width && alphaOffset<info.alphaData.length && offset<srcData.length; x++) {
srcData[offset] = info.alphaData[alphaOffset];
offset += 4;
alphaOffset += 1;

Back to the top