diff options
Diffstat (limited to 'examples/game_of_life/src')
-rw-r--r-- | examples/game_of_life/src/main.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/game_of_life/src/main.rs b/examples/game_of_life/src/main.rs index 2a8b3721..b0f1c96d 100644 --- a/examples/game_of_life/src/main.rs +++ b/examples/game_of_life/src/main.rs @@ -492,8 +492,10 @@ mod grid { let old_scaling = self.scaling; let scaling = (self.scaling * (1.0 + y / 30.0)) - .max(Self::MIN_SCALING) - .min(Self::MAX_SCALING); + .clamp( + Self::MIN_SCALING, + Self::MAX_SCALING, + ); let translation = if let Some(cursor_to_center) = |