Migration to winit 0.23

This commit is contained in:
Alex Komissarov 2020-10-21 01:10:16 +05:00
parent fb5c9fc8fe
commit d38731e472
No known key found for this signature in database
GPG Key ID: E7A6C70F46457C00
6 changed files with 13 additions and 13 deletions

View File

@ -14,7 +14,7 @@ image = "0.23"
log = "0.4" log = "0.4"
tobj = "2.0" tobj = "2.0"
wgpu = "0.6" wgpu = "0.6"
winit = "0.22" winit = "0.23"
[build-dependencies] [build-dependencies]
anyhow = "1.0" anyhow = "1.0"

View File

@ -1,7 +1,7 @@
use cgmath::*; use cgmath::*;
use std::f32::consts::FRAC_PI_2; use std::f32::consts::FRAC_PI_2;
use std::time::Duration; use std::time::Duration;
use winit::dpi::LogicalPosition; use winit::dpi::PhysicalPosition;
use winit::event::*; use winit::event::*;
#[rustfmt::skip] #[rustfmt::skip]
@ -143,7 +143,7 @@ impl CameraController {
self.scroll = match delta { self.scroll = match delta {
// I'm assuming a line is about 100 pixels // I'm assuming a line is about 100 pixels
MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0, MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0,
MouseScrollDelta::PixelDelta(LogicalPosition { y: scroll, .. }) => *scroll as f32, MouseScrollDelta::PixelDelta(PhysicalPosition { y: scroll, .. }) => *scroll as f32,
}; };
} }

View File

@ -15,7 +15,7 @@ log = "0.4"
rayon = "1.4" # NEW! rayon = "1.4" # NEW!
tobj = "2.0" tobj = "2.0"
wgpu = "0.6" wgpu = "0.6"
winit = "0.22" winit = "0.23"
[build-dependencies] [build-dependencies]
anyhow = "1.0" anyhow = "1.0"

View File

@ -1,7 +1,7 @@
use cgmath::*; use cgmath::*;
use std::f32::consts::FRAC_PI_2; use std::f32::consts::FRAC_PI_2;
use std::time::Duration; use std::time::Duration;
use winit::dpi::LogicalPosition; use winit::dpi::PhysicalPosition;
use winit::event::*; use winit::event::*;
#[rustfmt::skip] #[rustfmt::skip]
@ -143,7 +143,7 @@ impl CameraController {
self.scroll = -match delta { self.scroll = -match delta {
// I'm assuming a line is about 100 pixels // I'm assuming a line is about 100 pixels
MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0, MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0,
MouseScrollDelta::PixelDelta(LogicalPosition { y: scroll, .. }) => *scroll as f32, MouseScrollDelta::PixelDelta(PhysicalPosition { y: scroll, .. }) => *scroll as f32,
}; };
} }

View File

@ -1,7 +1,7 @@
use cgmath::*; use cgmath::*;
use std::f32::consts::FRAC_PI_2; use std::f32::consts::FRAC_PI_2;
use std::time::Duration; use std::time::Duration;
use winit::dpi::LogicalPosition; use winit::dpi::PhysicalPosition;
use winit::event::*; use winit::event::*;
#[cfg_attr(rustfmt, rustfmt_skip)] #[cfg_attr(rustfmt, rustfmt_skip)]
@ -157,7 +157,7 @@ impl CameraController {
self.scroll = -match delta { self.scroll = -match delta {
// I'm assuming a line is about 100 pixels // I'm assuming a line is about 100 pixels
MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0, MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0,
MouseScrollDelta::PixelDelta(LogicalPosition { y: scroll, .. }) => *scroll as f32, MouseScrollDelta::PixelDelta(PhysicalPosition { y: scroll, .. }) => *scroll as f32,
}; };
} }

View File

@ -7,7 +7,7 @@ I've been putting this off for a while. Implementing a camera isn't specifically
```rust ```rust
use cgmath::*; use cgmath::*;
use winit::event::*; use winit::event::*;
use winit::dpi::LogicalPosition; use winit::dpi::PhysicalPosition;
use std::time::Duration; use std::time::Duration;
use std::f32::consts::FRAC_PI_2; use std::f32::consts::FRAC_PI_2;
@ -184,7 +184,7 @@ impl CameraController {
self.scroll = -match delta { self.scroll = -match delta {
// I'm assuming a line is about 100 pixels // I'm assuming a line is about 100 pixels
MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0, MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0,
MouseScrollDelta::PixelDelta(LogicalPosition { MouseScrollDelta::PixelDelta(PhysicalPosition {
y: scroll, y: scroll,
.. ..
}) => *scroll as f32, }) => *scroll as f32,