|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2000, 2010 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2011 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 608-613
Link Here
|
| 608 |
if (data.height > SIZE || data.width > SIZE) { |
608 |
if (data.height > SIZE || data.width > SIZE) { |
| 609 |
// scale down to icon size |
609 |
// scale down to icon size |
| 610 |
copy= new Image(Display.getCurrent(), data.scaledTo(SIZE, SIZE)); |
610 |
copy= new Image(Display.getCurrent(), data.scaledTo(SIZE, SIZE)); |
|
|
611 |
|
| 612 |
} else if (data.height == SIZE && data.width == SIZE) { |
| 613 |
// nothing to scale, simply copy |
| 614 |
copy= new Image(image.getDevice(), image, SWT.IMAGE_COPY); |
| 615 |
|
| 611 |
} else { |
616 |
} else { |
| 612 |
// don't scale up, but rather copy into the middle and mark everything else transparent |
617 |
// don't scale up, but rather copy into the middle and mark everything else transparent |
| 613 |
ImageData mask= data.getTransparencyMask(); |
618 |
ImageData mask= data.getTransparencyMask(); |