mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
Make size/position types generic over pixel type (#1277)
* Begin implementing DPI generics * Fix multithreaded example * Format * Fix serde test * hopefully fix most of the errors * Fix dpi module errors * More error fixings * Format * fix macos errors * Another error pass * Replace bad type signatures * more fixins
This commit is contained in:
@@ -94,7 +94,7 @@ impl Canvas {
|
||||
self.raw.height() as f64
|
||||
}
|
||||
|
||||
pub fn set_size(&self, size: LogicalSize) {
|
||||
pub fn set_size(&self, size: LogicalSize<f64>) {
|
||||
self.raw.set_width(size.width as u32);
|
||||
self.raw.set_height(size.height as u32);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ pub fn mouse_modifiers(event: &MouseEvent) -> ModifiersState {
|
||||
m
|
||||
}
|
||||
|
||||
pub fn mouse_position(event: &MouseEvent) -> LogicalPosition {
|
||||
pub fn mouse_position(event: &MouseEvent) -> LogicalPosition<f64> {
|
||||
LogicalPosition {
|
||||
x: event.offset_x() as f64,
|
||||
y: event.offset_y() as f64,
|
||||
|
||||
@@ -40,7 +40,7 @@ impl WindowExtWebSys for Window {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn window_size() -> LogicalSize {
|
||||
pub fn window_size() -> LogicalSize<f64> {
|
||||
let window = web_sys::window().expect("Failed to obtain window");
|
||||
let width = window
|
||||
.inner_width()
|
||||
|
||||
Reference in New Issue
Block a user