1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 04:20:27 +01:00

WRaster: Changed formula for reconverting angle to the (0-360) bounds

There is a dedicaded floating point modulo operator that does a
better job (faster, no precision loss), so we use it instead of the
complicated formula that uses type conversions.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2013-06-16 21:51:02 +02:00
committed by Carlos R. Mafra
parent e9764aab71
commit 7bf8efef54

View File

@@ -52,7 +52,9 @@ RImage *RRotateImage(RImage * image, float angle)
*/
static const float min_usable_angle = 0.00699;
angle = ((int)angle % 360) + (angle - (int)angle);
angle = fmod(angle, 360.0);
if (angle < 0.0)
angle += 360.0;
if (angle < min_usable_angle) {
/* Rotate by 0 degree */