pub struct BaselineOffset(pub Option<f64>);Expand description
A wrapper that represents the baseline location of a RenderBox.
Tuple Fields§
§0: Option<f64>Implementations§
Source§impl BaselineOffset
impl BaselineOffset
Sourcepub const NO_BASELINE: BaselineOffset
pub const NO_BASELINE: BaselineOffset
A value that indicates that the associated RenderBox does not have any baselines.
BaselineOffset::NO_BASELINE is an identity element in most binary operations
involving two BaselineOffsets (such as min_of), for render objects
with no baselines typically do not contribute to the baseline offset of their parents.
Sourcepub fn offset(self) -> Option<f64>
pub fn offset(self) -> Option<f64>
The distance from the top of the box, or None for no baseline.
Sourcepub fn min_of(self, other: BaselineOffset) -> BaselineOffset
pub fn min_of(self, other: BaselineOffset) -> BaselineOffset
Compares this BaselineOffset and other, and returns whichever is closer to the
origin.
When both self and other are NO_BASELINE, this method returns
NO_BASELINE. When one of them is
NO_BASELINE, this method returns the other operand.
Trait Implementations§
Source§impl Add<f64> for BaselineOffset
impl Add<f64> for BaselineOffset
Source§fn add(self, offset: f64) -> BaselineOffset
fn add(self, offset: f64) -> BaselineOffset
Returns a new baseline location that is offset pixels further away from the origin than
self, or unchanged if self is NO_BASELINE.
Source§type Output = BaselineOffset
type Output = BaselineOffset
+ operator.