pub struct Border {
pub top: BorderSide,
pub right: BorderSide,
pub bottom: BorderSide,
pub left: BorderSide,
}Expand description
A border of a box, comprised of four sides: top, right, bottom, left.
Fields§
§top: BorderSideThe top side of this border.
right: BorderSideThe right side of this border.
bottom: BorderSideThe bottom side of this border.
left: BorderSideThe left side of this border.
Implementations§
Source§impl Border
impl Border
Sourcepub const fn from_border_side(side: BorderSide) -> Border
pub const fn from_border_side(side: BorderSide) -> Border
Creates a border whose sides are all the same.
Sourcepub const fn symmetric(vertical: BorderSide, horizontal: BorderSide) -> Border
pub const fn symmetric(vertical: BorderSide, horizontal: BorderSide) -> Border
Creates a border with symmetrical vertical and horizontal sides.
Sourcepub fn all(
color: Color,
width: f64,
style: BorderStyle,
stroke_align: f64,
) -> Border
pub fn all( color: Color, width: f64, style: BorderStyle, stroke_align: f64, ) -> Border
A uniform border with all sides the same color and width.
Trait Implementations§
Source§impl BoxBorder for Border
impl BoxBorder for Border
Source§fn top(&self) -> BorderSide
fn top(&self) -> BorderSide
The top side of this border.
Source§fn bottom(&self) -> BorderSide
fn bottom(&self) -> BorderSide
The bottom side of this border.
Source§fn is_uniform(&self) -> bool
fn is_uniform(&self) -> bool
Whether all four sides of the border are identical. Uniform borders are
typically more efficient to paint.
Source§fn paint(
&self,
canvas: &mut DisplayListBuilder,
rect: Rect,
text_direction: Option<TextDirection>,
shape: BoxShape,
border_radius: Option<BorderRadius>,
)
fn paint( &self, canvas: &mut DisplayListBuilder, rect: Rect, text_direction: Option<TextDirection>, shape: BoxShape, border_radius: Option<BorderRadius>, )
impl Copy for Border
Source§impl ShapeBorder for Border
impl ShapeBorder for Border
Source§fn dimensions(&self) -> EdgeInsetsGeometry
fn dimensions(&self) -> EdgeInsetsGeometry
The widths of the sides of this border represented as an
EdgeInsetsGeometry.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 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_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 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 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 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_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<Border>) -> Option<Rc<dyn BoxBorder>>
fn into_box_border(self: Rc<Border>) -> 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.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 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<Self>) -> Option<Rc<dyn OutlinedBorder>>
fn into_outlined_border(self: Rc<Self>) -> 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.impl StructuralPartialEq for Border
Auto Trait Implementations§
impl Forget for Border
impl Freeze for Border
impl Move for Border
impl RefUnwindSafe for Border
impl Send for Border
impl Sync for Border
impl Unpin for Border
impl UnsafeUnpin for Border
impl UnwindSafe for Border
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