Fix filtering out resize events in the ui

This commit is contained in:
Imbris 2020-07-26 18:21:20 -04:00
parent 1123073bfd
commit ba14440a49

View File

@ -239,8 +239,10 @@ impl Ui {
pub fn handle_event(&mut self, event: Event) { pub fn handle_event(&mut self, event: Event) {
match event.0 { match event.0 {
Input::Resize(w, h) if w > 1.0 && h > 1.0 => { Input::Resize(w, h) => {
self.window_resized = Some(Vec2::new(w, h)) if w > 1.0 && h > 1.0 {
self.window_resized = Some(Vec2::new(w, h))
}
}, },
Input::Touch(touch) => self.ui.handle_event(Input::Touch(Touch { Input::Touch(touch) => self.ui.handle_event(Input::Touch(Touch {
xy: self.scale.scale_point(touch.xy.into()).into_array(), xy: self.scale.scale_point(touch.xy.into()).into_array(),
@ -459,7 +461,7 @@ impl Ui {
|| image_h == 0 || image_h == 0
|| source_w < 1.0 || source_w < 1.0
|| source_h < 1.0 || source_h < 1.0
|| gl_size.reduce_partial_max() < f32::EPSILON || gl_size.reduce_partial_min() < f32::EPSILON
{ {
None None
} else { } else {