Less asserts
This commit is contained in:
parent
a40ba66209
commit
0e32467b24
|
|
@ -30,11 +30,11 @@ impl<S: Copy> DragCtl<S> {
|
|||
pub fn on_button(&mut self, pos: Vec2, state: ElementState) {
|
||||
match state {
|
||||
ElementState::Pressed => {
|
||||
assert!(self.ctl.is_none());
|
||||
if self.ctl.is_none() {
|
||||
self.ctl = Some((pos, self.state));
|
||||
}
|
||||
}
|
||||
ElementState::Released => {
|
||||
assert!(self.ctl.is_some());
|
||||
self.ctl = None;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user