Clamp animation slowdown to sane values
Browse files at this commitd8dcadc5b279c11e8cb8d1b0b064cc2b62c04099Parent: 6424a272 changed files +2 -2
- src/main.rs +1 -1
- src/niri.rs +1 -1
src/main.rsmodified+1 -1
| @@ -180,7 +180,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
| 180 | 180 | let slowdown = if config.animations.off { |
| 181 | 181 | 0. |
| 182 | 182 | } else { |
| 183 | - config.animations.slowdown | |
| 183 | + config.animations.slowdown.clamp(0., 100.) | |
| 184 | 184 | }; |
| 185 | 185 | animation::ANIMATION_SLOWDOWN.store(slowdown, Ordering::Relaxed); |
| 186 | 186 |
src/niri.rsmodified+1 -1
| @@ -585,7 +585,7 @@ impl State { | ||
| 585 | 585 | let slowdown = if config.animations.off { |
| 586 | 586 | 0. |
| 587 | 587 | } else { |
| 588 | - config.animations.slowdown | |
| 588 | + config.animations.slowdown.clamp(0., 100.) | |
| 589 | 589 | }; |
| 590 | 590 | animation::ANIMATION_SLOWDOWN.store(slowdown, Ordering::Relaxed); |
| 591 | 591 |