From: Michael Orlitzky Date: Wed, 10 Sep 2025 13:54:56 +0000 (-0400) Subject: index.html.in: intermediate variables for the client_to_svg ratio X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=94903e9fcfa714b6b70c26854f3bc163fcaf28e7;p=charm-bypass.git index.html.in: intermediate variables for the client_to_svg ratio This just makes things a little easier to read. --- diff --git a/index.html.in b/index.html.in index 76e808d..3cea854 100644 --- a/index.html.in +++ b/index.html.in @@ -691,7 +691,9 @@ * element's client rect. Since the size of the background is * fixed, this should give us a multiplier that turns client rect * distances (what we have) into SVG distances (what we want) */ - const client_to_svg = parseFloat(bg.getAttribute("width"))/r1.width; + const svg_width = parseFloat(bg.getAttribute("width")); + const client_width = r1.width; + const client_to_svg = svg_width / client_width; /* Convert hdelta from client rect to SVG coordinates */ const svg_hdelta = hdelta * client_to_svg;