Skip to main content

BorderRectLayout

Struct BorderRectLayout 

Source
pub struct BorderRectLayout {
    pub brush_size: Size2D<f32, PhysicalPx>,
    pub background_rect: Rect<f32, PhysicalPx>,
    pub background_radius: PhysicalBorderRadius,
    pub border_rect: Rect<f32, PhysicalPx>,
    pub border_radius: PhysicalBorderRadius,
    pub border_width: Length<f32, PhysicalPx>,
    pub border_color: Brush,
}
Expand description

The geometry for drawing a RenderBorderRectangle in the CSS box model, shared by the renderers that stroke the border centered on a path: the border is drawn entirely inside the item’s geometry, the background doesn’t extend under an opaque border, and brushes are resolved against the full border box.

Fields§

§brush_size: Size2D<f32, PhysicalPx>

The size of the border box, for resolving the background and border brushes.

§background_rect: Rect<f32, PhysicalPx>

The rectangle to fill with the background brush.

§background_radius: PhysicalBorderRadius

The corner radii of background_rect.

§border_rect: Rect<f32, PhysicalPx>

The rectangle to stroke with border_color when border_width is positive.

§border_radius: PhysicalBorderRadius

The corner radii of border_rect.

§border_width: Length<f32, PhysicalPx>

The stroke width of the border; zero for transparent borders.

§border_color: Brush

The border brush.

Implementations§

Source§

impl BorderRectLayout

Source

pub fn new( rect: Pin<&dyn RenderBorderRectangle>, size: LogicalSize, scale_factor: ScaleFactor, ) -> Option<Self>

Computes the layout for a border rectangle of size, or None when the geometry is empty.

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<T> ErasedDestructor for T
where T: 'static,

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, 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.