diff options
| author | Artemis Tosini <me@artem.ist> | 2024-01-25 15:34:35 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-25 15:34:35 +0000 |
| commit | 310a89cbd8314bf71eace29ce5a0ef91a1563e1c (patch) | |
| tree | 7a254c7d8dce9091c4fe8f79e80cd931aba5ff56 | |
| parent | 6359a83f8232a22e39bcecc306fc0d54dfc464a0 (diff) | |
Include units in top-level SVG element (#3233)
| -rw-r--r-- | crates/typst-svg/src/lib.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/typst-svg/src/lib.rs b/crates/typst-svg/src/lib.rs index 035ec330..2c69e6d9 100644 --- a/crates/typst-svg/src/lib.rs +++ b/crates/typst-svg/src/lib.rs @@ -247,8 +247,10 @@ impl SVGRenderer { "viewBox", format_args!("0 0 {} {}", size.x.to_pt(), size.y.to_pt()), ); - self.xml.write_attribute("width", &size.x.to_pt()); - self.xml.write_attribute("height", &size.y.to_pt()); + self.xml + .write_attribute_fmt("width", format_args!("{}pt", size.x.to_pt())); + self.xml + .write_attribute_fmt("height", format_args!("{}pt", size.y.to_pt())); self.xml.write_attribute("xmlns", "http://www.w3.org/2000/svg"); self.xml .write_attribute("xmlns:xlink", "http://www.w3.org/1999/xlink"); |
