pub struct Circle { /* private fields */ }
Implementations§
Source§impl Circle
impl Circle
pub fn as_rect(&self) -> Rect
👎Deprecated since 0.2.0: use as_outer_rect instead
Sourcepub fn as_outer_rect(&self) -> Rect
pub fn as_outer_rect(&self) -> Rect
Rectangle that surrounds the circle (lines touching circle, points outside)
Sourcepub fn as_inner_rect(&self) -> Rect
pub fn as_inner_rect(&self) -> Rect
Rectangle that fits inside the circle (points touching circle)
Sourcepub fn as_radius_line(&self) -> Line
pub fn as_radius_line(&self) -> Line
Create line from center to top edge at 0 degrees
Sourcepub fn as_horizontal_line(&self) -> Line
pub fn as_horizontal_line(&self) -> Line
Line from left to right
Sourcepub fn as_vertical_line(&self) -> Line
pub fn as_vertical_line(&self) -> Line
Line from top to bottom
pub fn as_ellipse(&self) -> Ellipse
Trait Implementations§
Source§impl ContainsShape for Circle
impl ContainsShape for Circle
Source§fn contains_circle(&self, circle: &Circle) -> bool
fn contains_circle(&self, circle: &Circle) -> bool
Returns true if
self
contains circle
Source§fn contains_ellipse(&self, ellipse: &Ellipse) -> bool
fn contains_ellipse(&self, ellipse: &Ellipse) -> bool
Returns true if
self
contains ellipse
Source§fn contains_rect(&self, rect: &Rect) -> bool
fn contains_rect(&self, rect: &Rect) -> bool
Returns true if
self
contains rect
Source§fn contains_line(&self, line: &Line) -> bool
fn contains_line(&self, line: &Line) -> bool
Returns true if
self
contains line
Source§fn contains_triangle(&self, triangle: &Triangle) -> bool
fn contains_triangle(&self, triangle: &Triangle) -> bool
Returns true if
self
contains triangle
Source§impl<'de> Deserialize<'de> for Circle
impl<'de> Deserialize<'de> for Circle
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Circle, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Circle, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl IntersectsContains for Circle
impl IntersectsContains for Circle
Source§impl IntersectsShape for Circle
impl IntersectsShape for Circle
Source§fn intersects_rect(&self, rect: &Rect) -> bool
fn intersects_rect(&self, rect: &Rect) -> bool
Returns true if
rect
intersects self
Source§fn intersects_circle(&self, circle: &Circle) -> bool
fn intersects_circle(&self, circle: &Circle) -> bool
Returns true if
circle
intersects self
Source§fn intersects_line(&self, line: &Line) -> bool
fn intersects_line(&self, line: &Line) -> bool
Returns true if
line
intersects self
Source§fn intersects_triangle(&self, triangle: &Triangle) -> bool
fn intersects_triangle(&self, triangle: &Triangle) -> bool
Returns true if
triangle
intersects self
Source§fn intersects_ellipse(&self, ellipse: &Ellipse) -> bool
fn intersects_ellipse(&self, ellipse: &Ellipse) -> bool
Returns true if
ellipse
intersects self
Source§fn intersects_polygon(&self, polygon: &Polygon) -> bool
fn intersects_polygon(&self, polygon: &Polygon) -> bool
Returns true if
polygon
intersects self
Source§impl Serialize for Circle
impl Serialize for Circle
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
Source§impl Shape for Circle
impl Shape for Circle
Source§fn translate_by(&self, delta: Coord) -> Circle
fn translate_by(&self, delta: Coord) -> Circle
change every point by +
delta
Source§fn move_to(&self, point: Coord) -> Circle
fn move_to(&self, point: Coord) -> Circle
moves the shapes first point to
point
(and changes every other point to match their original distance and angle) Read moreSource§fn move_center_to(&self, point: Coord) -> Circle
fn move_center_to(&self, point: Coord) -> Circle
Moves the shapes center to
point
(and changes every other point to match their original distance and angle) Read moreSource§fn outline_pixels(&self) -> Vec<Coord>
fn outline_pixels(&self) -> Vec<Coord>
The coords for drawing the shape outline, the points may be in any order
This should be cached rather than called per frame
Source§fn filled_pixels(&self) -> Vec<Coord>
fn filled_pixels(&self) -> Vec<Coord>
The coords for drawing the filled shape, the points may be in any order
This should be cached rather than called per frame
Source§fn to_shape_box(&self) -> ShapeBox
fn to_shape_box(&self) -> ShapeBox
Convert to ShapeBox, used to store shapes with type (for bulk drawing, etc)
Source§fn rotate_around(&self, degrees: isize, point: Coord) -> Selfwhere
Self: Sized,
fn rotate_around(&self, degrees: isize, point: Coord) -> Selfwhere
Self: Sized,
Rotate shape around a point
fn top_left(&self) -> Coord
fn top_right(&self) -> Coord
fn bottom_left(&self) -> Coord
fn bottom_right(&self) -> Coord
impl Eq for Circle
impl StructuralPartialEq for Circle
Auto Trait Implementations§
impl Freeze for Circle
impl RefUnwindSafe for Circle
impl Send for Circle
impl Sync for Circle
impl Unpin for Circle
impl UnwindSafe for Circle
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