Use i32 in Position::Physical (#1350)

* Use i32 in Position::Physical

* Fix multithreaded example

* format
This commit is contained in:
Osspial 2020-01-03 13:54:06 -05:00
parent 55166da437
commit 85ea3f1d5d
2 changed files with 5 additions and 2 deletions

View file

@ -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()
}

View file

@ -444,7 +444,7 @@ impl<P: Pixel> From<LogicalSize<P>> for Size {
#[derive(Debug, Copy, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum Position {
Physical(PhysicalPosition<u32>),
Physical(PhysicalPosition<i32>),
Logical(LogicalPosition<f64>),
}