fix large board territory render bug

This commit is contained in:
Sorrel Bri 2019-08-08 10:09:59 -07:00
parent ddefdf3655
commit c82f3da5af
2 changed files with 16 additions and 2 deletions

View file

@ -84,7 +84,8 @@
<div id="board-container">
<div id="board-space">
<table id="board">
<tbody><tr id="row-1">
<tbody>
<tr id="row-1">
<td id="1-1" class="top lft ">
<div class="stone" data-stone="none">
<div class="dot" data-dot="none">

View file

@ -470,7 +470,7 @@ function resolveCaptures(point) {
}
function editTerritory(evt) {
let placement = [ parseInt(evt.target.closest('td').id.split('-')[0]), parseInt(evt.target.closest('td').id[2]) ];
let placement = [ parseInt(evt.target.closest('td').id.split('-')[0]), parseInt(evt.target.closest('td').id.split('-')[1]) ];
let point = findPointFromIdx(placement);
point.cycleTerritory();
renderGame();
@ -580,9 +580,22 @@ function renderGame() {
function renderBoardInit() {
clearCurrentBoard();
renderBoardTableRows();
renderHoshi();
renderBoardTableStyle();
}
function renderHoshi() {
let hoshi = HANDI_PLACE[gameState.boardSize].slice(-1);
console.log(hoshi);
hoshi.forEach(star => {
console.log(star);
let starPt = findPointFromIdx(star);
console.log(starPt);
// .getElementsByClassName['dot'].style.className += ' hoshi' });
})
}
// HANDI_PLACE[gameState.boardSize].slice(-1) [0] [0][0] === boardState[20].pos[0]
function clearCurrentBoard() {
boardEl.innerHTML = '';
}