mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-25 00:10:05 +01:00
dix: use single return statement in ApplySimpleSoftening
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
This commit is contained in:
parent
c45f4cc6bd
commit
8ae90552f9
1 changed files with 7 additions and 6 deletions
|
|
@ -697,12 +697,13 @@ static inline float
|
|||
ApplySimpleSoftening(int prev_delta, int delta)
|
||||
{
|
||||
float result = delta;
|
||||
if (delta <= 1 && delta >= -1)
|
||||
return result;
|
||||
if (delta > prev_delta)
|
||||
result -= 0.5;
|
||||
else if (delta < prev_delta)
|
||||
result += 0.5;
|
||||
|
||||
if (delta < -1 || delta > 1) {
|
||||
if (delta > prev_delta)
|
||||
result -= 0.5;
|
||||
else if (delta < prev_delta)
|
||||
result += 0.5;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue