mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
stylo: Calculate font-size keywords based on base size
MozReview-Commit-ID: Ff6kt8RLChI
This commit is contained in:
parent
0aceddd47b
commit
fddddc9711
7 changed files with 130 additions and 27 deletions
|
@ -33,6 +33,14 @@ const AU_PER_Q: CSSFloat = AU_PER_MM / 4.;
|
|||
const AU_PER_PT: CSSFloat = AU_PER_IN / 72.;
|
||||
const AU_PER_PC: CSSFloat = AU_PER_PT * 12.;
|
||||
|
||||
/// Same as Gecko's AppUnitsToIntCSSPixels
|
||||
///
|
||||
/// Converts app units to integer pixel values,
|
||||
/// rounding during the conversion
|
||||
pub fn au_to_int_px(au: f32) -> i32 {
|
||||
(au / AU_PER_PX).round() as i32
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Copy, Debug)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
/// A font relative length.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue