From 9759b195a5f73569b6d918ca533a1d7423cfc5d8 Mon Sep 17 00:00:00 2001 From: Markus Kohlhase Date: Thu, 1 Aug 2019 16:31:22 +0200 Subject: [PATCH] Add 'width' and 'height' properties to SVG output --- src/render/svg.rs | 3 ++- src/test_annex_i_micro_qr_as_svg.svg | 2 +- src/test_annex_i_qr_as_svg.svg | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/render/svg.rs b/src/render/svg.rs index c1cd99e..348be92 100644 --- a/src/render/svg.rs +++ b/src/render/svg.rs @@ -51,7 +51,8 @@ impl<'a> RenderCanvas for Canvas<'a> { concat!( r#""#, r#""#, + r#" version="1.1" width="{w}" height="{h}""#, + r#" viewBox="0 0 {w} {h}" shape-rendering="crispEdges">"#, r#""#, r#" \ No newline at end of file + \ No newline at end of file diff --git a/src/test_annex_i_qr_as_svg.svg b/src/test_annex_i_qr_as_svg.svg index 9b97c0f..6f37446 100644 --- a/src/test_annex_i_qr_as_svg.svg +++ b/src/test_annex_i_qr_as_svg.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file