pub enum Effect {
Rounded {
radii: Corners,
},
}Expand description
One effect on one node.
Variants§
Implementations§
Source§impl Effect
impl Effect
Sourcepub const fn rounded(radii: Corners) -> Self
pub const fn rounded(radii: Corners) -> Self
Rounded corners at radii logical pixels, one value per corner.
Logical because this is the number a style writes, and a style does not
know what scale the window will land on. RADIUS_UNIFORM is where it
becomes physical, and says who multiplies.
A single shared radius is the common case, and that convenience now
lives on Corners::all rather than here: Effect::rounded(Corners::all(12.0))
is the old one-number behaviour.
Sourcepub const fn radii(&self) -> Corners
pub const fn radii(&self) -> Corners
The radii, in logical pixels, one per corner. RADIUS_UNIFORM is
the physical one, and the conversion between them is the caller’s.
Sourcepub fn largest(&self) -> f64
pub fn largest(&self) -> f64
The one number Corners::largest gives this effect’s radii – see
there for why the largest. A one-line delegate rather than a second
copy of the max chain, so the reasoning has exactly one home.
Sourcepub const fn is_none_effect(&self) -> bool
pub const fn is_none_effect(&self) -> bool
Whether this is an effect that should not be run at all.
No corner rounded is not “rounded by nothing”, it is no effect, and
the difference is a program on every surface of every window. Every
window on a machine with no styling declares one, so this is the arm
that keeps the ordinary case ordinary. See Corners::is_none for the
per-corner rule this now delegates to, NaN included.