summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-01-10 01:34:41 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-01-10 01:34:41 +0100
commitd15d1156bd0c7fa111d1c59bea11fd58b9cc63b1 (patch)
tree4e2598f2cf71b80f2e454391e65d2409b671778a
parent7ab6ed7ef912011318e07533e40fc98f4a846511 (diff)
downloadiced-d15d1156bd0c7fa111d1c59bea11fd58b9cc63b1.tar.gz
iced-d15d1156bd0c7fa111d1c59bea11fd58b9cc63b1.tar.bz2
iced-d15d1156bd0c7fa111d1c59bea11fd58b9cc63b1.zip
Produce `window::Event::Resized` in `iced_winit`
-rw-r--r--winit/src/application.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs
index da943660..8529c99c 100644
--- a/winit/src/application.rs
+++ b/winit/src/application.rs
@@ -2,8 +2,8 @@ use crate::{
container, conversion,
input::{keyboard, mouse},
renderer::{Target, Windowed},
- subscription, Cache, Clipboard, Command, Container, Debug, Element, Event,
- Length, MouseCursor, Settings, Subscription, UserInterface,
+ subscription, window, Cache, Clipboard, Command, Container, Debug, Element,
+ Event, Length, MouseCursor, Settings, Subscription, UserInterface,
};
/// An interactive, native cross-platform application.
@@ -373,10 +373,13 @@ pub trait Application: Sized {
*control_flow = ControlFlow::Exit;
}
WindowEvent::Resized(new_size) => {
+ events.push(Event::Window(window::Event::Resized {
+ width: new_size.width.round() as u32,
+ height: new_size.height.round() as u32,
+ }));
+
size = new_size;
resized = true;
-
- log::debug!("Resized: {:?}", new_size);
}
_ => {}
},