pub struct EllipseShape {
pub center: Pos2,
pub radius: Vec2,
pub fill: Color32,
pub stroke: Stroke,
pub angle: f32,
}Available on crate feature
egui only.Expand description
How to paint an ellipse.
Fields§
§center: Pos2§radius: Vec2Radius is the vector (a, b) where the width of the Ellipse is 2a and the height is 2b
fill: Color32§stroke: Stroke§angle: f32Rotate ellipse by this many radians clockwise around its center.
Implementations§
Source§impl EllipseShape
impl EllipseShape
pub fn filled( center: Pos2, radius: Vec2, fill_color: impl Into<Color32>, ) -> EllipseShape
pub fn stroke( center: Pos2, radius: Vec2, stroke: impl Into<Stroke>, ) -> EllipseShape
Sourcepub fn with_angle(self, angle: f32) -> EllipseShape
pub fn with_angle(self, angle: f32) -> EllipseShape
Set the rotation of the ellipse (in radians, clockwise). The ellipse rotates around its center.
Sourcepub fn with_angle_and_pivot(self, angle: f32, pivot: Pos2) -> EllipseShape
pub fn with_angle_and_pivot(self, angle: f32, pivot: Pos2) -> EllipseShape
Set the rotation of the ellipse (in radians, clockwise) around a custom pivot point.
Sourcepub fn visual_bounding_rect(&self) -> Rect
pub fn visual_bounding_rect(&self) -> Rect
The visual bounding rectangle (includes stroke width)
Trait Implementations§
Source§impl Clone for EllipseShape
impl Clone for EllipseShape
Source§fn clone(&self) -> EllipseShape
fn clone(&self) -> EllipseShape
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for EllipseShape
Source§impl Debug for EllipseShape
impl Debug for EllipseShape
Source§impl From<EllipseShape> for Shape
impl From<EllipseShape> for Shape
Source§fn from(shape: EllipseShape) -> Shape
fn from(shape: EllipseShape) -> Shape
Converts to this type from the input type.
Source§impl PartialEq for EllipseShape
impl PartialEq for EllipseShape
impl StructuralPartialEq for EllipseShape
Auto Trait Implementations§
impl Forget for EllipseShape
impl Freeze for EllipseShape
impl Move for EllipseShape
impl RefUnwindSafe for EllipseShape
impl Send for EllipseShape
impl Sync for EllipseShape
impl Unpin for EllipseShape
impl UnsafeUnpin for EllipseShape
impl UnwindSafe for EllipseShape
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more