pub struct CircleBorder {
pub side: BorderSide,
pub eccentricity: f64,
}Expand description
A border that fits a circle within the available space.
Typically used with ShapeDecoration to draw a circle.
The dimensions assume that the border is being
used in a square space. When applied to a rectangular space, the border
paints in the center of the rectangle.
The eccentricity parameter describes how much a circle will deform to
fit the rectangle it is a border for. A value of zero implies no
deformation (a circle touching at least two sides of the rectangle), a
value of one implies full deformation (an oval touching all sides of the
rectangle).
Fields§
§side: BorderSideThe border outline’s color and weight.
eccentricity: f64Defines the ratio (0.0-1.0) from which the border will deform to fit a rectangle.
When 0.0, it draws a circle touching at least two sides of the rectangle. When 1.0, it draws an oval touching all sides of the rectangle.
Implementations§
Source§impl CircleBorder
impl CircleBorder
Sourcepub fn new(side: BorderSide, eccentricity: f64) -> CircleBorder
pub fn new(side: BorderSide, eccentricity: f64) -> CircleBorder
Create a circle border.
Sourcepub fn scale(&self, t: f64) -> CircleBorder
pub fn scale(&self, t: f64) -> CircleBorder
Creates a copy of this border, scaled by the factor t.
Sourcepub fn copy_with(
&self,
side: Option<BorderSide>,
eccentricity: Option<f64>,
) -> CircleBorder
pub fn copy_with( &self, side: Option<BorderSide>, eccentricity: Option<f64>, ) -> CircleBorder
Returns a copy of this CircleBorder with the given fields replaced
with the new values.
Trait Implementations§
Source§impl Clone for CircleBorder
impl Clone for CircleBorder
Source§fn clone(&self) -> CircleBorder
fn clone(&self) -> CircleBorder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CircleBorder
Source§impl Debug for CircleBorder
impl Debug for CircleBorder
Source§impl Default for CircleBorder
impl Default for CircleBorder
Source§fn default() -> CircleBorder
fn default() -> CircleBorder
Source§impl OutlinedBorder for CircleBorder
impl OutlinedBorder for CircleBorder
Source§fn side(&self) -> BorderSide
fn side(&self) -> BorderSide
Source§fn copy_with(&self, side: Option<BorderSide>) -> OutlinedBorderRef
fn copy_with(&self, side: Option<BorderSide>) -> OutlinedBorderRef
OutlinedBorder that draws its outline with the
specified side, if side is Some.Source§impl PartialEq for CircleBorder
impl PartialEq for CircleBorder
Source§impl ShapeBorder for CircleBorder
impl ShapeBorder for CircleBorder
Source§fn dimensions(&self) -> EdgeInsetsGeometry
fn dimensions(&self) -> EdgeInsetsGeometry
EdgeInsetsGeometry.Source§fn scale(&self, t: f64) -> ShapeBorderRef
fn scale(&self, t: f64) -> ShapeBorderRef
t.Source§fn lerp_from(
&self,
a: Option<&(dyn ShapeBorder + 'static)>,
t: f64,
) -> Option<ShapeBorderRef>
fn lerp_from( &self, a: Option<&(dyn ShapeBorder + 'static)>, t: f64, ) -> Option<ShapeBorderRef>
Source§fn lerp_to(
&self,
b: Option<&(dyn ShapeBorder + 'static)>,
t: f64,
) -> Option<ShapeBorderRef>
fn lerp_to( &self, b: Option<&(dyn ShapeBorder + 'static)>, t: f64, ) -> Option<ShapeBorderRef>
Source§fn get_inner_path(
&self,
rect: Rect,
_text_direction: Option<TextDirection>,
) -> Path
fn get_inner_path( &self, rect: Rect, _text_direction: Option<TextDirection>, ) -> Path
Path that describes the inner edge of the border.Source§fn get_outer_path(
&self,
rect: Rect,
_text_direction: Option<TextDirection>,
) -> Path
fn get_outer_path( &self, rect: Rect, _text_direction: Option<TextDirection>, ) -> Path
Path that describes the outer edge of the border.Source§fn hit_test(
&self,
rect: Rect,
position: Offset,
_text_direction: Option<TextDirection>,
) -> bool
fn hit_test( &self, rect: Rect, position: Offset, _text_direction: Option<TextDirection>, ) -> bool
position.Source§fn paint_interior(
&self,
canvas: &mut DisplayListBuilder,
rect: Rect,
paint: &Paint,
_text_direction: Option<TextDirection>,
)
fn paint_interior( &self, canvas: &mut DisplayListBuilder, rect: Rect, paint: &Paint, _text_direction: Option<TextDirection>, )
Source§fn prefer_paint_interior(&self) -> bool
fn prefer_paint_interior(&self) -> bool
paint_interior is implemented.Source§fn paint(
&self,
canvas: &mut DisplayListBuilder,
rect: Rect,
_text_direction: Option<TextDirection>,
)
fn paint( &self, canvas: &mut DisplayListBuilder, rect: Rect, _text_direction: Option<TextDirection>, )
Source§fn as_outlined_border(&self) -> Option<&(dyn OutlinedBorder + 'static)>
fn as_outlined_border(&self) -> Option<&(dyn OutlinedBorder + 'static)>
OutlinedBorder downcast for Dart’s is OutlinedBorder.Source§fn into_outlined_border(
self: Rc<CircleBorder>,
) -> Option<Rc<dyn OutlinedBorder>>
fn into_outlined_border( self: Rc<CircleBorder>, ) -> Option<Rc<dyn OutlinedBorder>>
OutlinedBorder downcast of the shared border, for Dart’s as OutlinedBorder
(ShapeBorderRef::as_outlined_border_ref). An OutlinedBorder answers Some(self),
as it answers as_outlined_border.Source§fn eq_shape(&self, other: &(dyn ShapeBorder + 'static)) -> bool
fn eq_shape(&self, other: &(dyn ShapeBorder + 'static)) -> bool
== is identity; subclasses that override
== implement this.Source§fn add(&self, other: &ShapeBorderRef, reversed: bool) -> Option<ShapeBorderRef>
fn add(&self, other: &ShapeBorderRef, reversed: bool) -> Option<ShapeBorderRef>
this border and the other border. Read moreSource§fn as_box_border(&self) -> Option<&(dyn BoxBorder + 'static)>
fn as_box_border(&self) -> Option<&(dyn BoxBorder + 'static)>
BoxBorder downcast for BoxBorderRef::lerp.Source§fn into_box_border(self: Rc<Self>) -> Option<Rc<dyn BoxBorder>>
fn into_box_border(self: Rc<Self>) -> Option<Rc<dyn BoxBorder>>
BoxBorder downcast of the shared border
(ShapeBorderRef::as_box_border_ref). A box border answers Some(self), as it
answers as_box_border.impl StructuralPartialEq for CircleBorder
Auto Trait Implementations§
impl Forget for CircleBorder
impl Freeze for CircleBorder
impl Move for CircleBorder
impl RefUnwindSafe for CircleBorder
impl Send for CircleBorder
impl Sync for CircleBorder
impl Unpin for CircleBorder
impl UnsafeUnpin for CircleBorder
impl UnwindSafe for CircleBorder
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
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.