mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-22 10:21:04 +00:00
lazy_value.h: improve handling of low steps value
Don't just clamp the speed value to a positive number but immediately assign the destination value. This is needed in situations where the number of steps is too low for proper acceleration and deceleration. Issue #3096
This commit is contained in:
parent
2565928495
commit
b188a4dbc9
@ -76,7 +76,10 @@ class Lazy_value
|
|||||||
else
|
else
|
||||||
_speed -= _accel;
|
_speed -= _accel;
|
||||||
|
|
||||||
if (_speed < 1) _speed = 1;
|
if (_speed < 1) {
|
||||||
|
_speed = 0;
|
||||||
|
_curr = _dst;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
operator T () const { return _curr; }
|
operator T () const { return _curr; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user