Apparently all colors are supposed to be unsigned 16-bit values, but
addColors () was still assuming the range [0, 255].

Fix it to assume the range [0, 65535].

This fixes the zoom plugin, where the selection box is white and opaque,
instead of a nicely translucent shade.

Signed-off-by: Pekka Paalanen <[email protected]>
---
 plugins/opengl/src/vertexbuffer.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/plugins/opengl/src/vertexbuffer.cpp 
b/plugins/opengl/src/vertexbuffer.cpp
index 2255f7f..b99b44f 100644
--- a/plugins/opengl/src/vertexbuffer.cpp
+++ b/plugins/opengl/src/vertexbuffer.cpp
@@ -150,7 +150,7 @@ void GLVertexBuffer::addColors (GLuint nColors, GLushort 
*colors)
 
     for (GLuint i = 0; i < nColors * 4; i++)
     {
-       priv->colorData.push_back ((colors[i] & 0xFF) / 255.0f);
+       priv->colorData.push_back (colors[i] / 65535.0f);
     }
 }
 
-- 
1.7.3.4

_______________________________________________
dev mailing list
[email protected]
http://lists.compiz.org/mailman/listinfo/dev

Reply via email to