pub struct ContinuousRectangleBorder {
pub side: BorderSide,
pub border_radius: BorderRadiusGeometry,
}Expand description
A rectangular border with smooth continuous transitions between the straight sides and the rounded corners.
See also:
RoundedRectangleBorder, which creates rectangles with rounded corners, however its straight sides change into a rounded corner with a circular radius in a step function instead of gradually like theContinuousRectangleBorder.
Fields§
§side: BorderSideThe border outline’s color and weight.
border_radius: BorderRadiusGeometryThe radius for each corner.
Negative radius values are clamped to 0.0 by get_inner_path
and get_outer_path.
Implementations§
Source§impl ContinuousRectangleBorder
impl ContinuousRectangleBorder
Sourcepub fn new(
side: BorderSide,
border_radius: BorderRadiusGeometry,
) -> ContinuousRectangleBorder
pub fn new( side: BorderSide, border_radius: BorderRadiusGeometry, ) -> ContinuousRectangleBorder
Creates a ContinuousRectangleBorder.
Sourcepub fn scale(&self, t: f64) -> ContinuousRectangleBorder
pub fn scale(&self, t: f64) -> ContinuousRectangleBorder
Creates a copy of this border, scaled by the factor t.
Sourcepub fn copy_with(
&self,
side: Option<BorderSide>,
border_radius: Option<BorderRadiusGeometry>,
) -> ContinuousRectangleBorder
pub fn copy_with( &self, side: Option<BorderSide>, border_radius: Option<BorderRadiusGeometry>, ) -> ContinuousRectangleBorder
Returns a copy of this ContinuousRectangleBorder with the given fields replaced with the new values.
Trait Implementations§
Source§impl Clone for ContinuousRectangleBorder
impl Clone for ContinuousRectangleBorder
Source§fn clone(&self) -> ContinuousRectangleBorder
fn clone(&self) -> ContinuousRectangleBorder
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 ContinuousRectangleBorder
Source§impl Debug for ContinuousRectangleBorder
impl Debug for ContinuousRectangleBorder
Source§impl Default for ContinuousRectangleBorder
impl Default for ContinuousRectangleBorder
Source§fn default() -> ContinuousRectangleBorder
fn default() -> ContinuousRectangleBorder
Returns the “default value” for a type. Read more
Source§impl OutlinedBorder for ContinuousRectangleBorder
impl OutlinedBorder for ContinuousRectangleBorder
Source§fn side(&self) -> BorderSide
fn side(&self) -> BorderSide
The border outline’s color and weight.
Source§fn copy_with(&self, side: Option<BorderSide>) -> OutlinedBorderRef
fn copy_with(&self, side: Option<BorderSide>) -> OutlinedBorderRef
Returns a copy of this
OutlinedBorder that draws its outline with the
specified side, if side is Some.Source§impl ShapeBorder for ContinuousRectangleBorder
impl ShapeBorder for ContinuousRectangleBorder
Source§fn dimensions(&self) -> EdgeInsetsGeometry
fn dimensions(&self) -> EdgeInsetsGeometry
The widths of the sides of this border represented as an
EdgeInsetsGeometry.Source§fn scale(&self, t: f64) -> ShapeBorderRef
fn scale(&self, t: f64) -> ShapeBorderRef
Creates a copy of this border, scaled by the factor
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
Create a
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
Create a
Path that describes the outer edge of the border.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<ContinuousRectangleBorder>,
) -> Option<Rc<dyn OutlinedBorder>>
fn into_outlined_border( self: Rc<ContinuousRectangleBorder>, ) -> 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
Field equality. Dart’s default
== 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>
Attempts to create a new object that represents the amalgamation of
this border and the other border. Read moreSource§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
Tests whether the outer boundary of this border contains
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>, )
Paint a canvas with the appropriate shape. Read more
Source§fn prefer_paint_interior(&self) -> bool
fn prefer_paint_interior(&self) -> bool
Reports whether
paint_interior is implemented.Source§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 ContinuousRectangleBorder
Auto Trait Implementations§
impl Forget for ContinuousRectangleBorder
impl Freeze for ContinuousRectangleBorder
impl Move for ContinuousRectangleBorder
impl RefUnwindSafe for ContinuousRectangleBorder
impl Send for ContinuousRectangleBorder
impl Sync for ContinuousRectangleBorder
impl Unpin for ContinuousRectangleBorder
impl UnsafeUnpin for ContinuousRectangleBorder
impl UnwindSafe for ContinuousRectangleBorder
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