mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Format style component.
This commit is contained in:
parent
31fc6cd565
commit
8dab4d659a
120 changed files with 2207 additions and 1417 deletions
|
@ -32,8 +32,7 @@ impl Resolution {
|
|||
/// Convert this resolution value to dppx units.
|
||||
pub fn to_dppx(&self) -> CSSFloat {
|
||||
match *self {
|
||||
Resolution::X(f) |
|
||||
Resolution::Dppx(f) => f,
|
||||
Resolution::X(f) | Resolution::Dppx(f) => f,
|
||||
_ => self.to_dpi() / 96.0,
|
||||
}
|
||||
}
|
||||
|
@ -42,8 +41,7 @@ impl Resolution {
|
|||
pub fn to_dpi(&self) -> CSSFloat {
|
||||
match *self {
|
||||
Resolution::Dpi(f) => f,
|
||||
Resolution::X(f) |
|
||||
Resolution::Dppx(f) => f * 96.0,
|
||||
Resolution::X(f) | Resolution::Dppx(f) => f * 96.0,
|
||||
Resolution::Dpcm(f) => f * 2.54,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue