mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-26 03:36:32 +11:00
Use i32 in Position::Physical (#1350)
* Use i32 in Position::Physical * Fix multithreaded example * format
This commit is contained in:
parent
55166da437
commit
85ea3f1d5d
2 changed files with 5 additions and 2 deletions
|
@ -126,7 +126,10 @@ fn main() {
|
||||||
if let Size::Physical(size) = WINDOW_SIZE.into() {
|
if let Size::Physical(size) = WINDOW_SIZE.into() {
|
||||||
window
|
window
|
||||||
.set_cursor_position(Position::Physical(
|
.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()
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
|
@ -444,7 +444,7 @@ impl<P: Pixel> From<LogicalSize<P>> for Size {
|
||||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||||
pub enum Position {
|
pub enum Position {
|
||||||
Physical(PhysicalPosition<u32>),
|
Physical(PhysicalPosition<i32>),
|
||||||
Logical(LogicalPosition<f64>),
|
Logical(LogicalPosition<f64>),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue