mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-05 09:58:21 +02:00
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
1 changed files with 1 additions and 1 deletions
|
|
@ -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…
Add table
Reference in a new issue