Skip to main content

ShapeBorderClipper

Struct ShapeBorderClipper 

Source
pub struct ShapeBorderClipper {
    pub shape: Box<dyn ShapeBorder>,
    pub text_direction: Option<TextDirection>,
}
Expand description

A CustomClipper that clips to the outer path of a ShapeBorder.

Fields§

§shape: Box<dyn ShapeBorder>

The shape border whose outer path defines the clip.

§text_direction: Option<TextDirection>

The text direction to use for getting the outer path for shape.

ShapeBorders can depend on the text direction (e.g having a “dent” on the left hand side in LTR and on the right hand side in RTL).

Implementations§

Source§

impl ShapeBorderClipper

Source

pub fn new( shape: Box<dyn ShapeBorder>, text_direction: Option<TextDirection>, ) -> Self

Creates a ShapeBorder clipper.

The text_direction argument must be provided non-None if shape has a text direction dependency (for example if it is expressed in terms of “start” and “end” instead of “left” and “right”). It may be None if the border will not need the text direction to paint itself.

Trait Implementations§

Source§

impl CustomClipper<Arc<Path>> for ShapeBorderClipper

Source§

fn get_clip(&self, size: Size) -> Arc<Path> ⓘ

Returns a description of the clip given that the render object being clipped is of the given size.
Source§

fn should_reclip(&self, old_clipper: &dyn CustomClipper<Arc<Path>>) -> bool

Called whenever a new instance of the custom clipper delegate class is provided to the clip object, or any time that a new clip object is created with a new instance of the custom clipper delegate class (which amounts to the same thing, because the latter is implemented in terms of the former). Read more
Source§

fn as_any(&self) -> &dyn Any

Downcast support for Dart’s runtimeType comparison and covariant parameter.
Source§

fn reclip(&self) -> Option<&Rc<dyn Listenable>>

The Listenable that notifies when it is time to reclip. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>