pub struct BeveledRectangleBorder {
pub side: BorderSide,
pub border_radius: BorderRadiusGeometry,
}Expand description
A rectangular border with flattened or “beveled” corners.
The line segments that connect the rectangle’s four sides will begin at locations offset by the corresponding border radius, but not farther than the side’s center. If all the border radii exceed the sides’ half widths/heights the resulting shape is a diamond made by connecting the centers of the sides.
Fields§
§side: BorderSideThe border outline’s color and weight.
border_radius: BorderRadiusGeometryThe radii for each corner.
Each corner Radius defines the endpoints of
a line segment that spans the corner. The endpoints are located in the
same place as they would be for RoundedRectangleBorder, but they’re
connected by a straight line instead of an arc.
Negative radius values are clamped to 0.0 by get_inner_path
and get_outer_path.
Implementations§
Source§impl BeveledRectangleBorder
impl BeveledRectangleBorder
Sourcepub fn new(
side: BorderSide,
border_radius: BorderRadiusGeometry,
) -> BeveledRectangleBorder
pub fn new( side: BorderSide, border_radius: BorderRadiusGeometry, ) -> BeveledRectangleBorder
Creates a border like a RoundedRectangleBorder except that the corners
are joined by straight lines instead of arcs.
Sourcepub fn scale(&self, t: f64) -> BeveledRectangleBorder
pub fn scale(&self, t: f64) -> BeveledRectangleBorder
Creates a copy of this border, scaled by the factor t.
Sourcepub fn copy_with(
&self,
side: Option<BorderSide>,
border_radius: Option<BorderRadiusGeometry>,
) -> BeveledRectangleBorder
pub fn copy_with( &self, side: Option<BorderSide>, border_radius: Option<BorderRadiusGeometry>, ) -> BeveledRectangleBorder
Returns a copy of this BeveledRectangleBorder with the given fields replaced with the new values.
Trait Implementations§
Source§impl Clone for BeveledRectangleBorder
impl Clone for BeveledRectangleBorder
Source§fn clone(&self) -> BeveledRectangleBorder
fn clone(&self) -> BeveledRectangleBorder
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 BeveledRectangleBorder
Source§impl Debug for BeveledRectangleBorder
impl Debug for BeveledRectangleBorder
Source§impl Default for BeveledRectangleBorder
impl Default for BeveledRectangleBorder
Source§fn default() -> BeveledRectangleBorder
fn default() -> BeveledRectangleBorder
Source§impl OutlinedBorder for BeveledRectangleBorder
impl OutlinedBorder for BeveledRectangleBorder
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 BeveledRectangleBorder
impl PartialEq for BeveledRectangleBorder
Source§impl ShapeBorder for BeveledRectangleBorder
impl ShapeBorder for BeveledRectangleBorder
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 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<BeveledRectangleBorder>,
) -> Option<Rc<dyn OutlinedBorder>>
fn into_outlined_border( self: Rc<BeveledRectangleBorder>, ) -> 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 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 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.