pub struct Corners {
pub top_left: f64,
pub top_right: f64,
pub bottom_left: f64,
pub bottom_right: f64,
}Expand description
Four corner radii, independently – what lets a window be square-topped and round-bottomed, or any other combination, rather than one radius applied uniformly.
In logical pixels throughout, the same seam as Effect::radii: a
style writes these, and does not know what scale the window will land on.
Fields§
§top_left: f64§top_right: f64§bottom_left: f64§bottom_right: f64Implementations§
Source§impl Corners
impl Corners
Sourcepub const fn all(radius: f64) -> Self
pub const fn all(radius: f64) -> Self
One radius, all four corners. The common case, and the constructor
that used to be Effect::rounded’s whole job before a window was
allowed to differ corner to corner.
Sourcepub const fn is_none(&self) -> bool
pub const fn is_none(&self) -> bool
Whether every corner is <= 0.0 or NaN.
NaN is named rather than left to fall out of a negation, the same
spelling the single-radius Effect::is_none_effect used before this
existed: !(r > 0.0) says the same thing in fewer characters, but
clippy rejects a negated comparison on a partially ordered type – and
its objection is the point: NaN is incomparable, so r <= 0.0 on its
own would call it rounded and draw every surface through a program to
cut nothing.
Sourcepub fn max_of_side(&self) -> (f64, f64, f64, f64)
pub fn max_of_side(&self) -> (f64, f64, f64, f64)
Each side, measured by the larger of the two corners that touch it –
(top, right, bottom, left). A square-topped, round-bottomed window
must not give up its top rows to a corner it does not have.
Sourcepub fn largest(&self) -> f64
pub fn largest(&self) -> f64
The one number that stands for all four, for the clientRadius a layer
is still told. The largest, because that field’s only in-tree use is
an outward hug (PaneStyle.qml: clientRadius + 2, “hug it from
outside”), and a hug has to clear the biggest cut or it clips into it.