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:
parent
ef0e435052
commit
707b124168
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user