mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Guarded input for both directions in vertical drum picker.
This commit is contained in:
parent
bb4476890f
commit
d14e32f63e
1 changed files with 8 additions and 3 deletions
|
@ -101,9 +101,14 @@ VerticalDrumPicker::VerticalDrumPicker(
|
||||||
}
|
}
|
||||||
|
|
||||||
void VerticalDrumPicker::increaseShift(float64 by) {
|
void VerticalDrumPicker::increaseShift(float64 by) {
|
||||||
// Guard input.
|
{
|
||||||
if (by >= 1.) {
|
// Guard input.
|
||||||
by = .99;
|
constexpr auto kAlmostIndex = .99;
|
||||||
|
if (by >= 1.) {
|
||||||
|
by = kAlmostIndex;
|
||||||
|
} else if (by <= -1.) {
|
||||||
|
by = -kAlmostIndex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto shift = _shift;
|
auto shift = _shift;
|
||||||
|
|
Loading…
Add table
Reference in a new issue