Skip to content

Commit

Permalink
Panic if we set an axis value out of range.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgao committed Aug 7, 2019
1 parent d142a8e commit 0697031
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dhc/src/input/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ impl Axis {
}

pub fn set_value(&mut self, value: f32) {
if value < 0.0 || value > 1.0 {
panic!("invalid axis value: {}", value);
}

self.0 = value;
}
}
Expand Down

0 comments on commit 0697031

Please sign in to comment.