pub struct Ellipse { /* private fields */ }

Implementations§

source§

impl Ellipse

source

pub fn new<P>(center: P, width: usize, height: usize) -> Ellipsewhere P: Into<Coord>,

source§

impl Ellipse

source

pub fn width(&self) -> usize

source

pub fn height(&self) -> usize

source§

impl Ellipse

source

pub fn as_rect(&self) -> Rect

source

pub fn as_horizontal_line(&self) -> Line

source

pub fn as_vertical_line(&self) -> Line

source

pub fn as_radius_line(&self) -> Line

Create line from center to top edge at 0 degrees

source

pub fn as_circle(&self) -> Option<Circle>

Trait Implementations§

source§

impl Clone for Ellipse

source§

fn clone(&self) -> Ellipse

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl CreateDrawable<Ellipse> for Drawable<Ellipse>

source§

fn from_obj(shape: Ellipse, draw_type: DrawType) -> Drawable<Ellipse>

source§

impl Debug for Ellipse

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl FromDrawable<Ellipse> for ShapeBox

source§

impl FromShape<Ellipse> for ShapeBox

source§

fn from_shape(shape: Ellipse, draw_type: DrawType) -> ShapeBox

source§

impl PartialEq<Ellipse> for Ellipse

source§

fn eq(&self, other: &Ellipse) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Renderable<Ellipse> for Drawable<Ellipse>

source§

fn render(&self, graphics: &mut Graphics<'_>)

source§

impl Shape for Ellipse

source§

fn from_points(points: &[Coord]) -> Ellipsewhere Ellipse: Sized,

must be [top_left, bottom_right]

source§

fn points(&self) -> Vec<Coord, Global>

Returns [top_left, bottom_right]

source§

fn translate_by<P>(&self, delta: P) -> Ellipsewhere P: Into<Coord>,

change every point by +delta
source§

fn move_to<P>(&self, point: P) -> Ellipsewhere P: Into<Coord>,

moves the shapes first point to point (and changes every other point to match their original distance and angle) Read more
source§

fn contains<P>(&self, point: P) -> boolwhere P: Into<Coord>,

returns true if the shape contains point
source§

fn center(&self) -> Coord

center of shape
source§

fn left(&self) -> isize

x of the left most point
source§

fn right(&self) -> isize

x of the right most point
source§

fn top(&self) -> isize

y of the top most point
source§

fn bottom(&self) -> isize

y of the bottom most point
source§

fn move_center_to<P>(&self, point: P) -> Selfwhere P: Into<Coord>, Self: Sized,

moves the shapes centerto point (and changes every other point to match their original distance and angle) Read more
source§

fn rotate(&self, degrees: isize) -> Selfwhere Self: Sized,

rotate shape around it’s center
source§

fn rotate_around<P>(&self, degrees: isize, point: P) -> Selfwhere P: Into<Coord>, Self: Sized,

rotate shape around a point
source§

fn scale(&self, factor: f32) -> Selfwhere Self: Sized,

scale the shape by factor (around the center, so the change will be uniform)
source§

fn scale_around<P>(&self, factor: f32, point: P) -> Selfwhere P: Into<Coord>, Self: Sized,

scale the shape by factor around point
source§

impl Eq for Ellipse

source§

impl StructuralEq for Ellipse

source§

impl StructuralPartialEq for Ellipse

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.