#[non_exhaustive]pub struct ClipInset {
pub offsets: Edges<Points>,
pub fractions: Edges<Percentage>,
pub radii: Corners<Points>,
}Expand description
clipPath: CSS’s inset() shape, a rectangle inset from the view’s
border box, its corners rounded (inset(8px 0 0 50% round 12px)).
Everything the view draws shows only inside it (its background, borders,
shadows and the views in it), and only there is the view, or anything in
it, hit. It transitions (transitionProperty: "clip-path"), each edge and
radius on its own, so a panel can open out of a corner.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.offsets: Edges<Points>How far each edge moves in, in points (negative: out), besides
Self::fractions.
fractions: Edges<Percentage>How far each edge moves in as a fraction of the box’s width (left and
right) or height (top and bottom): CSS’s percentages. An edge is at
its offset plus its fraction of the size, as CSS’s calc(), which is
what an inset between a length and a percentage interpolates to.
radii: Corners<Points>The corners’ radii (round): circular, scaled down as a border’s are
where they do not fit.
Implementations§
Source§impl ClipInset
impl ClipInset
Sourcepub fn inset(self, length: impl Into<DefiniteLength>) -> Self
pub fn inset(self, length: impl Into<DefiniteLength>) -> Self
Moves every edge in by length.
Sourcepub fn top(self, length: impl Into<DefiniteLength>) -> Self
pub fn top(self, length: impl Into<DefiniteLength>) -> Self
Moves the top edge down by length (a fraction: of the height).
Sourcepub fn right(self, length: impl Into<DefiniteLength>) -> Self
pub fn right(self, length: impl Into<DefiniteLength>) -> Self
Moves the right edge left by length (a fraction: of the width).
Sourcepub fn bottom(self, length: impl Into<DefiniteLength>) -> Self
pub fn bottom(self, length: impl Into<DefiniteLength>) -> Self
Moves the bottom edge up by length (a fraction: of the height).
Sourcepub fn left(self, length: impl Into<DefiniteLength>) -> Self
pub fn left(self, length: impl Into<DefiniteLength>) -> Self
Moves the left edge right by length (a fraction: of the width).
Sourcepub fn corner_radii(self, radii: Corners<Points>) -> Self
pub fn corner_radii(self, radii: Corners<Points>) -> Self
Rounds each corner by its own radius.
Sourcepub fn resolve(&self, size: Size<Points>) -> (Bounds<Points>, CornerRadii)
pub fn resolve(&self, size: Size<Points>) -> (Bounds<Points>, CornerRadii)
The rectangle it clips a box of size to, in the box’s coordinates,
and its radii fitted to it. As CSS: two opposite edges that would
pass each other are moved in proportion until they meet, and radii
that do not fit are scaled down together.
Sourcepub fn outline(&self, size: Size<Points>, out: &mut impl FnMut(Segment))
pub fn outline(&self, size: Size<Points>, out: &mut impl FnMut(Segment))
The outline of the shape in a box of size, clockwise on screen
from the top edge, its corners circular arcs. Always the same
segments (a corner of radius 0 is a curve of length 0), so two
outlines interpolate segment by segment, as Core Animation animates
a path.