Struct 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: f32y: f32Implementations
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
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