Format style component.

This commit is contained in:
chansuke 2018-09-09 16:24:45 +02:00 committed by Emilio Cobos Álvarez
parent 31fc6cd565
commit 8dab4d659a
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
120 changed files with 2207 additions and 1417 deletions

View file

@ -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,
}
}