summaryrefslogtreecommitdiff
path: root/INSTALL
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2010-06-19 18:57:45 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2010-06-20 04:45:20 -0400
commit3074d57b560d5ec9be2a0e1a6846012698f51208 (patch)
tree3dc2395cd45731d3fd3492cfcc50840b4ee55f1d /INSTALL
parent66365b5ef1bb85863669227ae6e31134d8d57013 (diff)
Fix conical gradients to match QConicalGradient from Qt
Under the assumption that pixman gradients are supposed to match QConicalgradient, described here: http://doc.trolltech.com/4.4/qconicalgradient.html this patch fixes two separate bugs in pixman-conical-gradient.c. The first bug is that the output of atan2() is in the range of [-pi, pi], which means the parameter into the gradient can be negative. This is wrong since a QConicalGradient always interpolates around the center from 0 to 1. The fix for that is to (a) make sure the given angle is between 0 and 360, and (b) add or subtract 2 * M_PI if the computed angle ends up outside [0, 2 * pi]. The other bug is that we were interpolating clockwise, whereas QConicalGradient calls for a counter-clockwise interpolation. This is easily fixed by subtracting the parameter from 1. Finally, this patch encapsulates the computation in a new force-inline function so that it can be reused in both the affine and non-affine case.
Diffstat (limited to 'INSTALL')
0 files changed, 0 insertions, 0 deletions