Struct dotrix_egui::Pos2 [−]
Expand description
A position on screen.
Normally given in points (logical pixels).
Mathematically this is known as a “point”, but the term position was chosen so not to conflict with the unit (one point = X physical pixels).
Fields
x: f32
y: f32
Implementations
impl Pos2
impl Pos2
The zero position, the origin.
The top left corner in a GUI.
Same as Pos2::default()
.
👎 Deprecated:
Use Pos2::ZERO instead
The vector from origin to this position.
p.to_vec2()
is equivalent to p - Pos2::default()
.
pub fn distance_sq(self, other: Pos2) -> f32
Trait Implementations
pub fn add_assign(&mut self, rhs: Vec2)
pub fn add_assign(&mut self, rhs: Vec2)
Performs the +=
operation. Read more
impl Mul<Pos2> for RectTransform
impl Mul<Pos2> for RectTransform
Transforms the position.
impl<'_> Mul<Pos2> for &'_ RectTransform
impl<'_> Mul<Pos2> for &'_ RectTransform
Transforms the position.
pub fn sub_assign(&mut self, rhs: Vec2)
pub fn sub_assign(&mut self, rhs: Vec2)
Performs the -=
operation. Read more
impl StructuralPartialEq for Pos2
Auto Trait Implementations
impl RefUnwindSafe for Pos2
impl UnwindSafe for Pos2
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more