pub enum LengthSpec {
Pt(f64),
Relative(f64),
Em(f64),
Rem(f64),
}Expand description
A length in marquee’s four-way model. See the module docs for what each variant measures against.
Variants§
Pt(f64)
Absolute points.
Relative(f64)
Multiplier on the parent element’s value of the same field.
Em(f64)
Multiplier on this element’s own resolved font size.
Rem(f64)
Multiplier on the run’s base font size.
Implementations§
Source§impl LengthSpec
impl LengthSpec
Sourcepub fn resolve(self, parent_pt: f64, own_size_pt: f64, base_size_pt: f64) -> f64
pub fn resolve(self, parent_pt: f64, own_size_pt: f64, base_size_pt: f64) -> f64
Resolve to points.
parent_pt is the parent element’s resolved value of the same
field, own_size_pt this element’s resolved font size, and
base_size_pt the run’s base font size.
Sourcepub fn is_absolute(self) -> bool
pub fn is_absolute(self) -> bool
true when the value doesn’t depend on any inherited context.
Trait Implementations§
Source§impl Clone for LengthSpec
impl Clone for LengthSpec
Source§fn clone(&self) -> LengthSpec
fn clone(&self) -> LengthSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LengthSpec
Source§impl Debug for LengthSpec
impl Debug for LengthSpec
Source§impl Default for LengthSpec
impl Default for LengthSpec
Source§impl From<Length> for LengthSpec
impl From<Length> for LengthSpec
Source§impl PartialEq for LengthSpec
impl PartialEq for LengthSpec
impl StructuralPartialEq for LengthSpec
Auto Trait Implementations§
impl Freeze for LengthSpec
impl RefUnwindSafe for LengthSpec
impl Send for LengthSpec
impl Sync for LengthSpec
impl Unpin for LengthSpec
impl UnsafeUnpin for LengthSpec
impl UnwindSafe for LengthSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Brush for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.