Skip to content

Commit

Permalink
Port px & em dpi fix from #48
Browse files Browse the repository at this point in the history
  • Loading branch information
sameer committed Mar 4, 2024
1 parent 47e0301 commit 41a7a3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/converter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,10 @@ fn length_to_mm(l: svgtypes::Length, dpi: f64, scale: Option<f64>) -> f64 {
In => Length::new::<inch>(l.number),
Pc => Length::new::<pica_computer>(l.number) / dpi_scaling,
Pt => Length::new::<point_computer>(l.number) / dpi_scaling,
Px => Length::new::<inch>(l.number / dpi_scaling),
Px => Length::new::<inch>(l.number / dpi),
Em => {
warn!("Converting from em to millimeters assumes 1em = 16px");
Length::new::<inch>(16. * l.number / dpi_scaling)
Length::new::<inch>(16. * l.number / dpi)
}
Percent => {
if let Some(scale) = scale {
Expand Down

0 comments on commit 41a7a3d

Please sign in to comment.