sphair / ClanLib

ClanLib is a cross platform C++ toolkit library.
Other
344 stars 76 forks source link

Fixed linear gradient implementation. #51

Closed keigen-shu closed 9 years ago

keigen-shu commented 9 years ago

The previous implementation doesn't work on all angles. The new implementation now uses clan::Angle and follows the CSS specification; positive angles rotate the direction of the gradient clockwise with 0° pointing upwards (gradient runs from the bottom edge to the top edge of the box). 45° makes he gradient run diagonally from the bottom-left to the top-right, 90° makes the gradient run from left to right, and so on...