aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/consts.rs3
-rw-r--r--src/renderer.rs2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/consts.rs b/src/consts.rs
index 1a105f7..d864683 100644
--- a/src/consts.rs
+++ b/src/consts.rs
@@ -2,3 +2,6 @@ use fast_qr::ECL;
/// The error correction level to use for all QR code generation.
pub const QR_EC_LEVEL: ECL = ECL::L;
+
+/// The margin size for the SVG QR code on the webpage.
+pub const SVG_QR_MARGIN: usize = 1;
diff --git a/src/renderer.rs b/src/renderer.rs
index 77b9eed..562f215 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -322,7 +322,7 @@ fn qr_spoiler(show_qrcode: bool, content: impl AsRef<str>) -> Markup {
"QR code"
}
div.qrcode #qrcode {
- @match qr_code_svg(content, 1) {
+ @match qr_code_svg(content, consts::SVG_QR_MARGIN) {
Ok(svg) => (PreEscaped(svg)),
Err(err) => (format!("QR generation error: {:?}", err)),
}