From 4dbbbc13583314b5f738689afed20935969da652 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 13 Feb 2009 19:24:32 +0000 Subject: GUI: Fixed long-standing bug in calcGradient (gradients look a bit better now) svn-id: r36311 --- graphics/VectorRendererSpec.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'graphics') diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp index a6b3436e4c..4926479a8b 100644 --- a/graphics/VectorRendererSpec.cpp +++ b/graphics/VectorRendererSpec.cpp @@ -423,9 +423,9 @@ calcGradient(uint32 pos, uint32 max) { PixelType output = 0; pos = (MIN(pos * Base::_gradientFactor, max) << 12) / max; - output |= (_gradientStart + ((Base::_gradientBytes[0] * pos) >> 12)) & _redMask; - output |= (_gradientStart + ((Base::_gradientBytes[1] * pos) >> 12)) & _greenMask; - output |= (_gradientStart + ((Base::_gradientBytes[2] * pos) >> 12)) & _blueMask; + output |= ((_gradientStart&_redMask) + ((Base::_gradientBytes[0] * pos) >> 12)) & _redMask; + output |= ((_gradientStart&_greenMask) + ((Base::_gradientBytes[1] * pos) >> 12)) & _greenMask; + output |= ((_gradientStart&_blueMask) + ((Base::_gradientBytes[2] * pos) >> 12)) & _blueMask; output |= ~(_redMask | _greenMask | _blueMask); return output; -- cgit v1.2.3