display analysis from the right ply

This commit is contained in:
Thibault Duplessis 2015-05-07 09:58:10 +02:00
parent cab193c9fd
commit dc0480387f

View file

@ -205,8 +205,9 @@ function renderTurn(ctrl, turn, path) {
function renderTree(ctrl, tree) {
var turns = [];
var initPly = ctrl.analyse.firstPly();
for (i = 1, nb = tree.length; i < nb; i += 2) turns.push({
turn: Math.floor(i / 2) + 1,
turn: Math.floor((initPly + i) / 2) + 1,
white: tree[i],
black: tree[i + 1]
});