diff options
| author | Laurenz <laurmaedje@gmail.com> | 2024-02-14 16:07:38 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-14 15:07:38 +0000 |
| commit | 79e37ccbac080212dc42e996d760664c75d1a56f (patch) | |
| tree | 70c926c62535dd0df6f93d5a5a3e84326ed8aa9c /crates/typst-svg/src | |
| parent | 601118652de5b3151e96eba3c0c8c285f3fab8fd (diff) | |
Don't round SVG size (#3415)
Diffstat (limited to 'crates/typst-svg/src')
| -rw-r--r-- | crates/typst-svg/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/typst-svg/src/lib.rs b/crates/typst-svg/src/lib.rs index 2c69e6d9..4d542296 100644 --- a/crates/typst-svg/src/lib.rs +++ b/crates/typst-svg/src/lib.rs @@ -409,8 +409,8 @@ impl SVGRenderer { let glyph_hash = hash128(&(&text.font, id)); let id = self.glyphs.insert_with(glyph_hash, || { - let width = image.width() as f64; - let height = image.height() as f64; + let width = image.width(); + let height = image.height(); let url = convert_image_to_base64_url(&image); let ts = Transform::translate( Abs::pt(bitmap_x_offset), @@ -426,7 +426,7 @@ impl SVGRenderer { // The image is stored with the height of `image.height()`, but we want // to render it with a height of `target_height`. So we need to scale // it. - let scale_factor = target_height / image.height() as f64; + let scale_factor = target_height / image.height(); self.xml.write_attribute("x", &(x_offset / scale_factor)); self.xml.write_attribute_fmt( "transform", |
