Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraradermache2013-05-21 11:39:38 +0000
committeraradermache2013-05-21 11:39:38 +0000
commit69426cef6e8af1090320bebb3ca965851ffd0712 (patch)
tree0c16aabe420f95fe5a2d286ecb30d85e08cb4d50 /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication
parentd7af2fba2cfdad64221cf8f82b6b4115ede25b62 (diff)
downloadorg.eclipse.papyrus-69426cef6e8af1090320bebb3ca965851ffd0712.tar.gz
org.eclipse.papyrus-69426cef6e8af1090320bebb3ca965851ffd0712.tar.xz
org.eclipse.papyrus-69426cef6e8af1090320bebb3ca965851ffd0712.zip
Bug 391729 - [Communication Diagram] message arrow icon is corrupted
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/custom-src/org/eclipse/papyrus/uml/diagram/communication/custom/helper/RotationHelper.java17
1 files changed, 10 insertions, 7 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/custom-src/org/eclipse/papyrus/uml/diagram/communication/custom/helper/RotationHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/custom-src/org/eclipse/papyrus/uml/diagram/communication/custom/helper/RotationHelper.java
index f210600271c..9cf45e1dc02 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/custom-src/org/eclipse/papyrus/uml/diagram/communication/custom/helper/RotationHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/custom-src/org/eclipse/papyrus/uml/diagram/communication/custom/helper/RotationHelper.java
@@ -14,6 +14,7 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.communication.custom.helper;
+import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Transparency;
@@ -107,17 +108,19 @@ public class RotationHelper {
transform.translate(-w/2, -h/2); // old center
ImageData newImageData = new ImageData(neww, newh, imageData.depth, imageData.palette);
- // make all pixel transparent (is there a better way to do that?)
- for (int y = 0; y <newh ; y++) {
- for (int x = 0; x < neww ; x++) {
- newImageData.setAlpha(x, y, 0);
- }
- }
+ // Use "white" as transparent pixel instead of real transparency. The latter would raise cross platform
+ // issues, since the same image file leads to an image with alpha data on Linux (32 bit depth, 8 for alpha)
+ // and one without alpha on windows (8 bit depth only).
+ newImageData.transparentPixel = newImageData.palette.getPixel(new RGB(
+ Color.white.getRed(),
+ Color.white.getGreen(),
+ Color.white.getBlue()));
final Image newImage = new Image(PlatformUI.getWorkbench().getDisplay(), newImageData);
GC gc = new GC(newImage);
+ gc.fillRectangle(0, 0, neww, newh);
gc.setTransform(transform);
gc.drawImage(image, 0, 0);
-
+
gc.dispose();
return newImage;

Back to the top