pub struct ScreenCoordinates { /* private fields */ }
Expand description
ScreenCoordinates
represents a point on the screen. It can be created from pixels, pips, or
millimeters and the coordinate vales can be retrieved in any of those units.
Implementations§
Source§impl ScreenCoordinates
impl ScreenCoordinates
Sourcepub fn from_pixels(x: f32, y: f32, display_metrics: DisplayMetrics) -> Self
pub fn from_pixels(x: f32, y: f32, display_metrics: DisplayMetrics) -> Self
Create a ScreenCoordinates
from the given pixel corrdinates
Sourcepub fn from_pips(x: f32, y: f32, display_metrics: DisplayMetrics) -> Self
pub fn from_pips(x: f32, y: f32, display_metrics: DisplayMetrics) -> Self
Create a ScreenCoordinates
from the given pip corrdinates
Sourcepub fn from_mm(x: f32, y: f32, display_metrics: DisplayMetrics) -> Self
pub fn from_mm(x: f32, y: f32, display_metrics: DisplayMetrics) -> Self
Create a ScreenCoordinates
from the given millimeter corrdinates
Sourcepub fn from_position(
position: &Position,
display_metrics: DisplayMetrics,
) -> Self
pub fn from_position( position: &Position, display_metrics: DisplayMetrics, ) -> Self
This takes a Position struct and maps it to ScreenCoordinates
Trait Implementations§
Source§impl Clone for ScreenCoordinates
impl Clone for ScreenCoordinates
Source§fn clone(&self) -> ScreenCoordinates
fn clone(&self) -> ScreenCoordinates
Returns a copy 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 ScreenCoordinates
impl Debug for ScreenCoordinates
impl Copy for ScreenCoordinates
Auto Trait Implementations§
impl Freeze for ScreenCoordinates
impl RefUnwindSafe for ScreenCoordinates
impl Send for ScreenCoordinates
impl Sync for ScreenCoordinates
impl Unpin for ScreenCoordinates
impl UnwindSafe for ScreenCoordinates
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)