/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Computed types for box properties.
usecrate::derives::*; usecrate::values::animated::{Animate, Procedure, ToAnimatedValue}; usecrate::values::computed::length::{LengthPercentage, NonNegativeLength}; usecrate::values::computed::{Context, Integer, Number, ToComputedValue}; usecrate::values::generics::box_::{
GenericBaselineShift, GenericContainIntrinsicSize, GenericLineClamp, GenericOverflowClipMargin,
GenericPerspective,
}; usecrate::values::specified::box_ as specified; use std::fmt; use style_traits::{CssWriter, ToCss};
impl Zoom { /// The value 1. This is by far the most common value. pubconst ONE: Zoom = Zoom(1.0);
/// The `document` value. This can appear in the computed zoom property value, but not in the /// `effective_zoom` field. pubconst DOCUMENT: Zoom = Zoom(0.0);
/// Returns whether we're the number 1. #[inline] pubfn is_one(self) -> bool { self == Self::ONE
}
/// Returns the value as a float. #[inline] pubfn value(&self) -> f32 { self.0
}
/// Computes the effective zoom for a given new zoom value in rhs. pubfn compute_effective(self, specified: Self) -> Self { if specified == Self::DOCUMENT { returnSelf::ONE;
} ifself == Self::ONE { return specified;
} if specified == Self::ONE { returnself;
}
Zoom(self.0 * specified.0)
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.