From e2bbefdc245dcffd050c9419b7688a2a99a6e24c Mon Sep 17 00:00:00 2001 From: "J.W. Jagersma" Date: Tue, 29 Sep 2020 21:56:02 +0200 Subject: [PATCH] clamp waterfall canvas width to 100% for fft_size < canvas_max_midth --- htdocs/openwebrx.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index e48dfe55c..b2a746912 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -1245,7 +1245,7 @@ var canvas_actual_line; function add_canvas() { canvas_subcontainer = document.createElement("div"); - var n = fft_size / canvas_max_width; + var n = Math.max(fft_size / canvas_max_width, 1); var w = 100 / n; for (var i = 0; i < n; ++i) { var new_canvas = document.createElement("canvas");