]> git.sesse.net Git - remoteglot/blobdiff - www/js/remoteglot.js
Revert "Show retained/interpolated scores with 50% alpha."
[remoteglot] / www / js / remoteglot.js
index b06a45ae2d82ff37b720b53087a7ae244da296bf..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) { 
@@ -2063,12 +2063,12 @@ let onDragStart = function(source, piece, position, orientation) {
 }
 
 let mousedownSquare = function(e) {
-       if (!e.target || !e.target.matches('.square-55d63')) {
+       if (!e.target || !e.target.closest('.square-55d63')) {
                return;
        }
 
        reverse_dragging_from = null;
-       let square = e.target.getAttribute('data-square');
+       let square = e.target.closest('.square-55d63').getAttribute('data-square');
 
        let pseudogame = new Chess(display_fen);
        if (pseudogame.game_over() === true) {
@@ -2093,13 +2093,13 @@ let mousedownSquare = function(e) {
 }
 
 let mouseupSquare = function(e) {
-       if (!e.target || !e.target.matches('.square-55d63')) {
+       if (!e.target || !e.target.closest('.square-55d63')) {
                return;
        }
        if (reverse_dragging_from === null) {
                return;
        }
-       let source = e.target.getAttribute('data-square');
+       let source = e.target.closest('.square-55d63').getAttribute('data-square');
        let target = reverse_dragging_from;
        reverse_dragging_from = null;
        if (onDrop(source, target) !== 'snapback') {
@@ -2228,7 +2228,7 @@ let onSnapEnd = function(source, target) {
                }
                let line = display_lines[i];
                if (line.pv[line.start_display_move_num] === move.san) {
-                       show_line(i, line.start_display_move_num);
+                       show_line(i, 0);
                        return;
                }
        }