summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-07-15 13:06:28 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-07-17 14:27:26 +1000
commit74469895e39fa38337f59edd64c4031ab9bb51d8 (patch)
treef4c599430bfc26c2f9bb594ebb102cd85d60c953 /dix
parent0e3be0b25fcfeff386bad132526352c2e45f1932 (diff)
dix: allow a ConstantDeceleration between 0 and 1 (#66134)
A constant deceleration of x simply means (delta * 1/x). We limited that to values >= 1.0f for obvious reasons, but can also allow values from 0-1. That means that ConstantDeceleration is actually a ConstantAcceleration, but hey, if someone needs it... X.Org Bug 66134 <http://bugs.freedesktop.org/show_bug.cgi?id=66134> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'dix')
-rw-r--r--dix/ptrveloc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index d6fef9cf3..e75300a17 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -245,11 +245,10 @@ AccelSetDecelProperty(DeviceIntPtr dev, Atom atom,
if (checkOnly) {
if (rc)
return rc;
- return (v >= 1.0f) ? Success : BadValue;
+ return (v > 0) ? Success : BadValue;
}
- if (v >= 1.0f)
- vel->const_acceleration = 1 / v;
+ vel->const_acceleration = 1 / v;
return Success;
}