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:
Osspial 2020-01-04 01:33:07 -05:00
parent b16042a047
commit 3a1e694c2f
40 changed files with 388 additions and 336 deletions

View file

@ -422,7 +422,7 @@ impl Window {
///
/// [safe area]: https://developer.apple.com/documentation/uikit/uiview/2891103-safeareainsets?language=objc
#[inline]
pub fn inner_position(&self) -> Result<PhysicalPosition, NotSupportedError> {
pub fn inner_position(&self) -> Result<PhysicalPosition<i32>, NotSupportedError> {
self.window.inner_position()
}
@ -441,7 +441,7 @@ impl Window {
/// - **iOS:** Can only be called on the main thread. Returns the top left coordinates of the
/// window in the screen space coordinate system.
#[inline]
pub fn outer_position(&self) -> Result<PhysicalPosition, NotSupportedError> {
pub fn outer_position(&self) -> Result<PhysicalPosition<i32>, NotSupportedError> {
self.window.outer_position()
}
@ -470,7 +470,7 @@ impl Window {
///
/// [safe area]: https://developer.apple.com/documentation/uikit/uiview/2891103-safeareainsets?language=objc
#[inline]
pub fn inner_size(&self) -> PhysicalSize {
pub fn inner_size(&self) -> PhysicalSize<u32> {
self.window.inner_size()
}
@ -498,7 +498,7 @@ impl Window {
/// - **iOS:** Can only be called on the main thread. Returns the `PhysicalSize` of the window in
/// screen space coordinates.
#[inline]
pub fn outer_size(&self) -> PhysicalSize {
pub fn outer_size(&self) -> PhysicalSize<u32> {
self.window.outer_size()
}