[][src]Struct widgetry::screen_geom::ScreenRectangle

pub struct ScreenRectangle {
    pub x1: f64,
    pub y1: f64,
    pub x2: f64,
    pub y2: f64,
}

ScreenRectangle is in units of logical pixels, as opposed to physical pixels.

Fields

x1: f64y1: f64x2: f64y2: f64

Implementations

impl ScreenRectangle[src]

pub fn top_left(top_left: ScreenPt, dims: ScreenDims) -> ScreenRectangle[src]

pub fn placeholder() -> ScreenRectangle[src]

pub fn contains(&self, pt: ScreenPt) -> bool[src]

pub fn pt_to_percent(&self, pt: ScreenPt) -> Option<(f64, f64)>[src]

pub fn percent_to_pt(&self, x: f64, y: f64) -> ScreenPt[src]

pub fn width(&self) -> f64[src]

pub fn height(&self) -> f64[src]

pub fn dims(&self) -> ScreenDims[src]

pub fn center(&self) -> ScreenPt[src]

pub fn to_polygon(&self) -> Polygon[src]

Trait Implementations

impl Clone for ScreenRectangle[src]

impl Debug for ScreenRectangle[src]

Auto Trait Implementations

impl RefUnwindSafe for ScreenRectangle

impl Send for ScreenRectangle

impl Sync for ScreenRectangle

impl Unpin for ScreenRectangle

impl UnwindSafe for ScreenRectangle

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.