mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Guarded input for both directions in vertical drum picker.
This commit is contained in:
@@ -101,9 +101,14 @@ VerticalDrumPicker::VerticalDrumPicker(
|
||||
}
|
||||
|
||||
void VerticalDrumPicker::increaseShift(float64 by) {
|
||||
// Guard input.
|
||||
if (by >= 1.) {
|
||||
by = .99;
|
||||
{
|
||||
// Guard input.
|
||||
constexpr auto kAlmostIndex = .99;
|
||||
if (by >= 1.) {
|
||||
by = kAlmostIndex;
|
||||
} else if (by <= -1.) {
|
||||
by = -kAlmostIndex;
|
||||
}
|
||||
}
|
||||
|
||||
auto shift = _shift;
|
||||
|
||||
Reference in New Issue
Block a user