summaryrefslogtreecommitdiff
path: root/gdk/x11/gdkcc-x11.c
diff options
context:
space:
mode:
authorMET 1998 Eckehard Berns <eb@berns.prima.de>1998-02-21 23:25:34 +0000
committerEckehard Berns <eb@src.gnome.org>1998-02-21 23:25:34 +0000
commite00c0594a3a338cd99e80bf4bcccc86d83febcaf (patch)
tree6518b417c01e5feb01557c1e6c19268f918db74b /gdk/x11/gdkcc-x11.c
parent75a8405430560c2071596f7154c01ab7cb684827 (diff)
downloadgtk+-e00c0594a3a338cd99e80bf4bcccc86d83febcaf.tar.gz
fixed a bug for mode GDK_CC_MODE_TRUE, when on a 24-bit visual on a 32-bit
Sun Feb 22 00:20:12 MET 1998 Eckehard Berns <eb@berns.prima.de> * gdk/gdkcc.c (gdk_color_context_query_colors): fixed a bug for mode GDK_CC_MODE_TRUE, when on a 24-bit visual on a 32-bit mashine.
Diffstat (limited to 'gdk/x11/gdkcc-x11.c')
-rw-r--r--gdk/x11/gdkcc-x11.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdk/x11/gdkcc-x11.c b/gdk/x11/gdkcc-x11.c
index 7224b3e939..28ecad7feb 100644
--- a/gdk/x11/gdkcc-x11.c
+++ b/gdk/x11/gdkcc-x11.c
@@ -1405,9 +1405,9 @@ gdk_color_context_query_colors (GdkColorContext *cc,
if (cc->clut == NULL)
for (i = 0, tc = colors; i < num_colors; i++, tc++)
{
- tc->red = (tc->pixel & cc->masks.red) * 65535 / cc->masks.red;
- tc->green = (tc->pixel & cc->masks.green) * 65535 / cc->masks.green;
- tc->blue = (tc->pixel & cc->masks.blue) * 65535 / cc->masks.blue;
+ tc->red = ((tc->pixel & cc->masks.red) >> cc->shifts.red) << (16 - cc->bits.red);
+ tc->green = ((tc->pixel & cc->masks.green) >> cc->shifts.green) << (16 - cc->bits.green);
+ tc->blue = ((tc->pixel & cc->masks.blue) >> cc->shifts.blue) << (16 - cc->bits.blue);
}
else
{