mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
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.
This commit is contained in:
@ -533,8 +533,8 @@ function initPuzzle() {
|
||||
* <https://developer.mozilla.org/en-US/docs/Web/API/Window/
|
||||
* devicePixelRatio> (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 })
|
||||
|
Reference in New Issue
Block a user