Struct epaint::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
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
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