From 1b95807ac6975b56eb641d4a2c8b9147178b3d64 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sat, 28 Sep 2019 07:36:28 +0200 Subject: [PATCH] beautiful 2x scale for retina displays --- htdocs/openwebrx.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index 5508d0e..9c0b819 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -901,8 +901,16 @@ function mkscale() function resize_scale() { - scale_ctx.canvas.width = window.innerWidth; - scale_ctx.canvas.height = 47; + ratio = window.devicePixelRatio || 1; + var w = window.innerWidth; + var h = 47; + scale_canvas.style.width = w + "px"; + scale_canvas.style.height = h + "px"; + w *= ratio; + h *= ratio; + scale_canvas.width = w; + scale_canvas.height = h; + scale_ctx.scale(ratio, ratio); mkscale(); } @@ -1339,7 +1347,6 @@ function dial_button_click() { var available = find_dial_frequencies(); if (!available.length) return; var frequency = available[0].frequency; - console.info(frequency); demodulator_set_offset_frequency(0, frequency - center_freq); $("#webrx-actual-freq").html(format_frequency("{x} MHz", frequency, 1e6, 4)); }