zng_unit

Type Alias DipCornerRadius

Source
pub type DipCornerRadius = CornerRadius2D<Dip, Dip>;
Expand description

Corner-radius in device independent pixels.

Aliased Type§

struct DipCornerRadius {
    pub top_left: Size2D<Dip, Dip>,
    pub top_right: Size2D<Dip, Dip>,
    pub bottom_right: Size2D<Dip, Dip>,
    pub bottom_left: Size2D<Dip, Dip>,
}

Fields§

§top_left: Size2D<Dip, Dip>

Top-left corner radius.

§top_right: Size2D<Dip, Dip>

Top-right corner radius.

§bottom_right: Size2D<Dip, Dip>

Bottom-right corner radius.

§bottom_left: Size2D<Dip, Dip>

Bottom-left corner radius.

Implementations

Source§

impl<T: Copy + Zero, U> CornerRadius2D<T, U>

Source

pub fn new( top_left: Size2D<T, U>, top_right: Size2D<T, U>, bottom_right: Size2D<T, U>, bottom_left: Size2D<T, U>, ) -> Self

New with distinct values.

Source

pub fn new_all(radius: Size2D<T, U>) -> Self

New all corners same radius.

Source

pub fn zero() -> Self

All zeros.

Source

pub fn inflate(self, offsets: SideOffsets2D<T, U>) -> Self
where T: AddAssign,

Calculate the corner radius of an outer border around self to perfectly fit.

Source

pub fn deflate(self, offsets: SideOffsets2D<T, U>) -> Self
where T: SubAssign + PartialOrd,

Calculate the corner radius of an inner border inside self to perfectly fit.

Trait Implementations§

Source§

impl DipToPx for DipCornerRadius

Source§

type AsPx = CornerRadius2D<Px, Px>

Self equivalent in Px units.
Source§

fn to_px(self, scale_factor: Factor) -> Self::AsPx

Multiply the Dip self by the scale.
Source§

impl<T: Clone, U> Clone for CornerRadius2D<T, U>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, U> Debug for CornerRadius2D<T, U>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Default, U> Default for CornerRadius2D<T, U>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de, T, U> Deserialize<'de> for CornerRadius2D<T, U>
where T: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T: PartialEq, U> PartialEq for CornerRadius2D<T, U>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T, U> Serialize for CornerRadius2D<T, U>
where T: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T: Copy, U> Copy for CornerRadius2D<T, U>

Source§

impl<T: Eq, U> Eq for CornerRadius2D<T, U>