Fixed window resizing

Former-commit-id: 81f2e18274aadb53b07704cf10c5c27efdccb032
This commit is contained in:
Joshua Barretto 2019-05-07 12:27:40 +01:00
parent df9b64355a
commit 6da495f0bd
2 changed files with 3 additions and 3 deletions

View File

@ -202,8 +202,8 @@ impl Renderer {
/// Get the resolution of the render target.
pub fn get_resolution(&self) -> Vec2<u16> {
Vec2::new(
self.tgt_color_view.get_dimensions().0,
self.tgt_color_view.get_dimensions().1,
self.win_color_view.get_dimensions().0,
self.win_color_view.get_dimensions().1,
)
}

View File

@ -101,7 +101,7 @@ impl Window {
glutin::Event::WindowEvent { event, .. } => match event {
glutin::WindowEvent::CloseRequested => events.push(Event::Close),
glutin::WindowEvent::Resized(glutin::dpi::LogicalSize { width, height }) => {
let (mut color_view, mut depth_view) = renderer.tgt_views_mut();
let (mut color_view, mut depth_view) = renderer.win_views_mut();
gfx_window_glutin::update_views(&window, &mut color_view, &mut depth_view);
renderer.on_resize().unwrap();
events.push(Event::Resize(Vec2::new(width as u32, height as u32)));