pub struct EllipseShape {
pub center: Pos2,
pub radius: Vec2,
pub fill: Color32,
pub stroke: Stroke,
pub angle: f32,
}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>, ) -> Self
pub fn stroke(center: Pos2, radius: Vec2, stroke: impl Into<Stroke>) -> Self
Sourcepub fn with_angle(self, angle: f32) -> Self
pub fn with_angle(self, angle: f32) -> Self
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) -> Self
pub fn with_angle_and_pivot(self, angle: f32, pivot: Pos2) -> Self
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EllipseShape
impl Debug for EllipseShape
Source§impl From<EllipseShape> for Shape
impl From<EllipseShape> for Shape
Source§fn from(shape: EllipseShape) -> Self
fn from(shape: EllipseShape) -> Self
Converts to this type from the input type.
Source§impl PartialEq for EllipseShape
impl PartialEq for EllipseShape
impl Copy for EllipseShape
impl StructuralPartialEq for EllipseShape
Auto Trait Implementations§
impl Freeze for EllipseShape
impl RefUnwindSafe for EllipseShape
impl Send for EllipseShape
impl Sync for EllipseShape
impl Unpin 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