#[repr(C)]pub struct ScreenPosition {
pub x: f32,
pub y: f32,
}Expand description
Position in screen coordinates (logical pixels, relative to primary monitor origin). On Wayland: falls back to window-local since global coords are unavailable.
Fields§
§x: f32§y: f32Implementations§
Source§impl ScreenPosition
impl ScreenPosition
pub const fn new(x: f32, y: f32) -> Self
pub const fn zero() -> Self
Sourcepub const fn to_logical(self) -> LogicalPosition
pub const fn to_logical(self) -> LogicalPosition
Convert to a raw LogicalPosition (for interop with existing code).
Sourcepub const fn from_logical(p: LogicalPosition) -> Self
pub const fn from_logical(p: LogicalPosition) -> Self
Create from a raw LogicalPosition that is known to be in screen space.
Trait Implementations§
Source§impl Clone for ScreenPosition
impl Clone for ScreenPosition
Source§fn clone(&self) -> ScreenPosition
fn clone(&self) -> ScreenPosition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScreenPosition
impl Debug for ScreenPosition
Source§impl Default for ScreenPosition
impl Default for ScreenPosition
Source§fn default() -> ScreenPosition
fn default() -> ScreenPosition
Returns the “default value” for a type. Read more
Source§impl PartialEq for ScreenPosition
impl PartialEq for ScreenPosition
Source§impl PartialOrd for ScreenPosition
impl PartialOrd for ScreenPosition
impl Copy for ScreenPosition
impl StructuralPartialEq for ScreenPosition
Auto Trait Implementations§
impl Freeze for ScreenPosition
impl RefUnwindSafe for ScreenPosition
impl Send for ScreenPosition
impl Sync for ScreenPosition
impl Unpin for ScreenPosition
impl UnsafeUnpin for ScreenPosition
impl UnwindSafe for ScreenPosition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more