[haiku-webkit-commits] r213 - webkit/trunk/WebKit/haiku/HaikuLauncher

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Thu, 25 Feb 2010 13:40:03 +0000

Author: stippi
Date: Thu Feb 25 12:49:38 2010
New Revision: 213
URL: http://mmlr.dyndns.org/changeset/213

Log:
What the heck... use the correct weighting for calculating the average grey.

Modified:
   webkit/trunk/WebKit/haiku/HaikuLauncher/IconButton.cpp

Modified: webkit/trunk/WebKit/haiku/HaikuLauncher/IconButton.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/HaikuLauncher/IconButton.cpp      Thu Feb 25 
12:46:28 2010        (r212)
+++ webkit/trunk/WebKit/haiku/HaikuLauncher/IconButton.cpp      Thu Feb 25 
12:49:38 2010        (r213)
@@ -821,8 +821,9 @@
                                                cBits[nOffset + 3] = 
fBits[fOffset + 3];
                                                // disabled bits have less 
opacity
 
-                                               uint8 grey = 
((uint16)nBits[nOffset + 0] + nBits[nOffset + 1]
-                                                       + nBits[nOffset + 2]) / 
3;
+                                               uint8 grey = 
((uint16)nBits[nOffset + 0] * 10
+                                                   + nBits[nOffset + 1] * 60
+                                                       + nBits[nOffset + 2] * 
30) / 100;
                                                float dist = (nBits[nOffset + 
0] - grey) * 0.3;
                                                dBits[nOffset + 0] = 
(uint8)(grey + dist);
                                                dist = (nBits[nOffset + 1] - 
grey) * 0.3;

Other related posts: