This will waste a tiiiiny bit of time because we only call this
function in contexts where we already have the security code
background element handy (and the new function recomputes it),
but it's so much cleaner as a separate function.
}
+ /**
+ * Convert SVG units into client (HTML/CSS) units based
+ * on the declared/rendered width of the code background.
+ */
+ function svg_to_client() {
+ const codebg = document.getElementById("codebg");
+ const client_width = codebg.getBoundingClientRect().width;
+ const svg_width = parseFloat(codebg.getAttribute("width"));
+ return client_width / svg_width;
+ }
+
/**
* Resize the ticket background based on the service name.
* The BaltimoreLink, Commuter Bus, and MARC Train tickets