From 85ea3f1d5d1016af087061e9f3e2dd11002c4f29 Mon Sep 17 00:00:00 2001 From: Osspial Date: Fri, 3 Jan 2020 13:54:06 -0500 Subject: [PATCH] Use i32 in Position::Physical (#1350) * Use i32 in Position::Physical * Fix multithreaded example * format --- examples/multithreaded.rs | 5 ++++- src/dpi.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/multithreaded.rs b/examples/multithreaded.rs index c91ce5a5..ba52ef59 100644 --- a/examples/multithreaded.rs +++ b/examples/multithreaded.rs @@ -126,7 +126,10 @@ fn main() { if let Size::Physical(size) = WINDOW_SIZE.into() { window .set_cursor_position(Position::Physical( - PhysicalPosition::new(size.width / 2, size.height / 2), + PhysicalPosition::new( + size.width as i32 / 2, + size.height as i32 / 2, + ), )) .unwrap() } diff --git a/src/dpi.rs b/src/dpi.rs index 664b22cb..6f0311d3 100644 --- a/src/dpi.rs +++ b/src/dpi.rs @@ -444,7 +444,7 @@ impl From> for Size { #[derive(Debug, Copy, Clone, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum Position { - Physical(PhysicalPosition), + Physical(PhysicalPosition), Logical(LogicalPosition), }