[]Struct druid::UnitPoint

pub struct UnitPoint { /* fields omitted */ }

A representation of a point relative to a unit rectangle.

Implementations

impl UnitPoint

pub const TOP_LEFT: UnitPoint

pub const TOP: UnitPoint

pub const TOP_RIGHT: UnitPoint

pub const LEFT: UnitPoint

pub const CENTER: UnitPoint

pub const RIGHT: UnitPoint

pub const BOTTOM_LEFT: UnitPoint

pub const BOTTOM: UnitPoint

pub const BOTTOM_RIGHT: UnitPoint

pub const fn new(u: f64, v: f64) -> UnitPoint

Create a new UnitPoint.

The u and v coordinates describe the point, with (0.0, 0.0) being the top-left, and (1.0, 1.0) being the bottom-right.

pub fn resolve(&self, rect: Rect) -> Point

Given a rectangle, resolve the point within the rectangle.

Trait Implementations

impl Clone for UnitPoint

impl Copy for UnitPoint

impl Debug for UnitPoint

Auto Trait Implementations

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> From<T> for T[src]

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

impl<T> RoundFrom<T> for T

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 

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.