Skip to content

Commit

Permalink
feat: 修改resolution为dpi的单位
Browse files Browse the repository at this point in the history
  • Loading branch information
heiazu committed Jul 30, 2024
1 parent 4ec767e commit e16092e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/style_propetries/style_media.rs
Original file line number Diff line number Diff line change
@@ -300,9 +300,9 @@ impl StyleMedia {
},
MediaFeatureValue::Resolution(value) => {
let num = match value {
lightningcss::values::resolution::Resolution::Dpi(val) => *val/96.0,
lightningcss::values::resolution::Resolution::Dpcm(val) => *val/37.7953,
lightningcss::values::resolution::Resolution::Dppx(val) => *val,
lightningcss::values::resolution::Resolution::Dpi(val) => *val,
lightningcss::values::resolution::Resolution::Dpcm(val) => *val * 96.0 / 37.7953,
lightningcss::values::resolution::Resolution::Dppx(val) => *val * 96.0,
};
return Some(MediaValueType::Float(num as f64));
},

0 comments on commit e16092e

Please # to comment.