dix: prefer lroundf() over roundf() in axis scaling

it's unclear whether there actually is a problem, but in a very similar
case there is (bug#21456). Also, integer addition is generally faster.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Simon Thum 2009-03-21 18:19:19 +01:00 committed by Peter Hutterer
parent ef0e435052
commit 707b124168

View File

@ -260,7 +260,7 @@ rescaleValuatorAxis(int coord, AxisInfoPtr from, AxisInfoPtr to,
if(fmax == fmin) /* avoid division by 0 */
return 0;
return roundf(((float)(coord - fmin)) * (tmax - tmin) /
return lroundf(((float)(coord - fmin)) * (tmax - tmin) /
(fmax - fmin)) + tmin;
}