]> git.sesse.net Git - remoteglot/commitdiff
Fix min/max range for the most recent move.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 23 Dec 2022 23:39:57 +0000 (00:39 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 23 Dec 2022 23:39:57 +0000 (00:39 +0100)
www/js/remoteglot.js

index c96335feb62baeacd88435fcc65c91c6375920b2..59d94129097f8bd3c882ad2cdf024d57d03ac359 100644 (file)
@@ -1395,7 +1395,10 @@ let update_sparkline = function(data) {
                                scores.push(last_score);
                        }
                        if (data['score']) {
-                               scores.push(compute_plot_score(data['score']));
+                               let score = compute_plot_score(data['score']);
+                               scores.push(score);
+                               if (score < min_score) min_score = score;
+                               if (score > max_score) max_score = score;
                        }
 
                        const h = scorespark.getBoundingClientRect().height;