Struct emath::Pos2 [−][src]
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
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()
.
Trait Implementations
Performs the +=
operation. Read more
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Transforms the position.
Transforms the position.
Performs the -=
operation. Read more
Auto Trait Implementations
impl RefUnwindSafe for Pos2
impl UnwindSafe for Pos2
Blanket Implementations
Mutably borrows from an owned value. Read more