[][src]Struct egui::math::Pos2

pub struct Pos2 {
    pub x: f32,
    pub y: f32,
}

Sometimes called a Point. I prefer the shorter Pos2 so it is equal length to Vec2

Fields

x: f32y: f32

Implementations

impl Pos2[src]

pub fn to_vec2(self) -> Vec2[src]

pub fn distance(self, other: Self) -> f32[src]

pub fn distance_sq(self, other: Self) -> f32[src]

pub fn floor(self) -> Self[src]

pub fn round(self) -> Self[src]

pub fn ceil(self) -> Self[src]

pub fn is_finite(self) -> bool[src]

#[must_use]pub fn min(self, other: Self) -> Self[src]

#[must_use]pub fn max(self, other: Self) -> Self[src]

#[must_use]pub fn clamp(self, range: RangeInclusive<Self>) -> Self[src]

Trait Implementations

impl Add<Vec2> for Pos2[src]

type Output = Pos2

The resulting type after applying the + operator.

impl AddAssign<Vec2> for Pos2[src]

impl Clone for Pos2[src]

impl Copy for Pos2[src]

impl Debug for Pos2[src]

impl Default for Pos2[src]

impl Eq for Pos2[src]

impl From<[f32; 2]> for Pos2[src]

impl PartialEq<Pos2> for Pos2[src]

impl Sub<Pos2> for Pos2[src]

type Output = Vec2

The resulting type after applying the - operator.

impl Sub<Vec2> for Pos2[src]

type Output = Pos2

The resulting type after applying the - operator.

impl SubAssign<Vec2> for Pos2[src]

Auto Trait Implementations

impl RefUnwindSafe for Pos2

impl Send for Pos2

impl Sync for Pos2

impl Unpin for Pos2

impl UnwindSafe for Pos2

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> 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.