]> git.sesse.net Git - remoteglot/commitdiff
Align the sparkline a bit better.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 26 Dec 2022 11:15:28 +0000 (12:15 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 26 Dec 2022 11:15:28 +0000 (12:15 +0100)
www/js/remoteglot.js

index 0aa071aa35a6d88fe6527199eaa3d444a6595a3a..b0c89cb750a8e179a0e87b03132da53fec7db000 100644 (file)
@@ -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) {