From 9e927bcf5c3b917f739bd7baea9cfe89fb7e4b32 Mon Sep 17 00:00:00 2001 From: Shun Sakai Date: Thu, 26 Sep 2024 19:27:40 +0900 Subject: [PATCH 1/2] chore(svg): Reduce size of SVG output --- src/render/svg.rs | 4 ++-- src/test_annex_i_micro_qr_as_svg.svg | 2 +- src/test_annex_i_qr_as_svg.svg | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/render/svg.rs b/src/render/svg.rs index a1b3332..81eea34 100644 --- a/src/render/svg.rs +++ b/src/render/svg.rs @@ -51,7 +51,7 @@ impl<'a> RenderCanvas for Canvas<'a> { r#""#, - r#""#, + r#""#, r#" RenderCanvas for Canvas<'a> { } fn draw_dark_rect(&mut self, left: u32, top: u32, width: u32, height: u32) { - write!(self.svg, "M{left} {top}h{width}v{height}H{left}V{top}").unwrap(); + write!(self.svg, "M{left} {top}h{width}v{height}h-{width}z").unwrap(); } fn into_image(mut self) -> String { diff --git a/src/test_annex_i_micro_qr_as_svg.svg b/src/test_annex_i_micro_qr_as_svg.svg index d855689..1422252 100644 --- a/src/test_annex_i_micro_qr_as_svg.svg +++ b/src/test_annex_i_micro_qr_as_svg.svg @@ -1 +1 @@ - \ 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 b536763..5283d26 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 From 1d0c47701dc3f448c133b3b95400c6330cd3fa8d Mon Sep 17 00:00:00 2001 From: Shun Sakai Date: Thu, 26 Sep 2024 22:12:29 +0900 Subject: [PATCH 2/2] chore(svg): Reduce size of background --- src/render/svg.rs | 2 +- src/test_annex_i_micro_qr_as_svg.svg | 2 +- src/test_annex_i_qr_as_svg.svg | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/render/svg.rs b/src/render/svg.rs index 81eea34..732cb4b 100644 --- a/src/render/svg.rs +++ b/src/render/svg.rs @@ -51,7 +51,7 @@ impl<'a> RenderCanvas for Canvas<'a> { r#""#, - r#""#, + 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 5283d26..c959849 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