This just makes things a little easier to read.
* 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;