From: Steinar H. Gunderson Date: Mon, 26 Dec 2022 11:15:28 +0000 (+0100) Subject: Align the sparkline a bit better. X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=851ce06837efdb286c4fe801a1949ecc0f694c93 Align the sparkline a bit better. --- diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index 0aa071a..b0c89cb 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -1427,16 +1427,16 @@ let update_sparkline = function(data) { let color; if (scores[i] === 0) { color = [0.5, 0.5, 0.5]; - rect.setAttributeNS(null, 'y', base_y - 1); + rect.setAttributeNS(null, 'y', base_y); rect.setAttributeNS(null, 'height', 1); } else if (scores[i] > 0) { color = [0.2, 0.4, 0.8]; rect.setAttributeNS(null, 'y', base_y - extent); - rect.setAttributeNS(null, 'height', extent); + rect.setAttributeNS(null, 'height', extent + 1); } else { color = [1.0, 0.267, 0.267]; rect.setAttributeNS(null, 'y', base_y); - rect.setAttributeNS(null, 'height', -extent); + rect.setAttributeNS(null, 'height', -extent + 1); } let hlcolor = [color[0], color[1], color[2]]; if (scores[i] !== 0) {