mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 13:51:30 +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
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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>),
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue