Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBing-Yi Wong2019-01-07 07:57:36 +0000
committerAndrey Loskutov2019-01-07 15:28:44 +0000
commita69de14bfef952f5ad5831b2a13a48694d29a42d (patch)
tree2e58727167d9d122628b86cefbe8bd619be671e0
parent812da1b42753fc8045cb015984ee90074e069a49 (diff)
downloadeclipse.platform.swt-a69de14bfef952f5ad5831b2a13a48694d29a42d.tar.gz
eclipse.platform.swt-a69de14bfef952f5ad5831b2a13a48694d29a42d.tar.xz
eclipse.platform.swt-a69de14bfef952f5ad5831b2a13a48694d29a42d.zip
Bug 543027 - [GTK3] Some tooltips display in black background while some
in normal background Casts (signed) byte to unsigned int because the data is actually unsigned int. If not, the data become negative int, which results in black background. Test strategy Check several parts described in the Bug JUnit Tests performed None Change-Id: I2ef5a2cf5b66f517fd0f722715f6fdd90cee249b Signed-off-by: Bing-Yi Wong <kis36205@yahoo.com.tw>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
index 1d5dc12a09..f1ef2d01af 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
@@ -3152,9 +3152,9 @@ GdkRGBA getBackgroundColor (long /*int*/ context, int state) {
Cairo.cairo_surface_flush (surface);
byte[] buffer = new byte[3];
C.memmove (buffer, Cairo.cairo_image_surface_get_data(surface), buffer.length);
- rgba.red = buffer[2] / 255f;
- rgba.green = buffer[1] / 255f;
- rgba.blue = buffer[0] / 255f;
+ rgba.red = Byte.toUnsignedInt(buffer[2]) / 255f;
+ rgba.green = Byte.toUnsignedInt(buffer[1]) / 255f;
+ rgba.blue = Byte.toUnsignedInt(buffer[0]) / 255f;
rgba.alpha = 1.0;
Cairo.cairo_surface_destroy (surface);
Cairo.cairo_destroy (cairo);

Back to the top