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: f32
y: f32
Implementations
impl Pos2
impl Pos2
The zero position, the origin.
The top left corner in a GUI.
Same as Pos2::default()
.
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<'de> Deserialize<'de> for Pos2
impl<'de> Deserialize<'de> for Pos2
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Pos2, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Pos2, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
pub fn sub_assign(&mut self, rhs: Vec2)
pub fn sub_assign(&mut self, rhs: Vec2)
Performs the -=
operation. Read more
impl Pod for Pos2
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