From 94903e9fcfa714b6b70c26854f3bc163fcaf28e7 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 10 Sep 2025 09:54:56 -0400 Subject: [PATCH] index.html.in: intermediate variables for the client_to_svg ratio This just makes things a little easier to read. --- index.html.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.49.0