From a62217e9b42e81a66369f91600991944d148e0a9 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sun, 23 Oct 2022 11:15:31 +0100 Subject: [PATCH] js: Use less-modern syntax in update_pixel_ratio Stealing code from the MDN has the consequence that it uses shiny ES6 features like "const", "let", and "=>". This looks a bit odd among the more conservative style of the rest of Puzzles, so I've downgraded it to "var" and "function". I'll let the template string stay because that actually helps readability. --- emccpre.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emccpre.js b/emccpre.js index 2dd4a18..96a9af8 100644 --- a/emccpre.js +++ b/emccpre.js @@ -533,8 +533,8 @@ function initPuzzle() { * (CC0). */ - const update_pixel_ratio = () => { - let dpr = window.devicePixelRatio; + var update_pixel_ratio = function() { + var dpr = window.devicePixelRatio; resizable_div.style.width = onscreen_canvas.width / dpr + "px"; matchMedia(`(resolution: ${dpr}dppx)`) .addEventListener("change", update_pixel_ratio, { once: true })