fix large board territory render bug
This commit is contained in:
parent
ddefdf3655
commit
c82f3da5af
2 changed files with 16 additions and 2 deletions
|
@ -84,7 +84,8 @@
|
||||||
<div id="board-container">
|
<div id="board-container">
|
||||||
<div id="board-space">
|
<div id="board-space">
|
||||||
<table id="board">
|
<table id="board">
|
||||||
<tbody><tr id="row-1">
|
<tbody>
|
||||||
|
<tr id="row-1">
|
||||||
<td id="1-1" class="top lft ">
|
<td id="1-1" class="top lft ">
|
||||||
<div class="stone" data-stone="none">
|
<div class="stone" data-stone="none">
|
||||||
<div class="dot" data-dot="none">
|
<div class="dot" data-dot="none">
|
||||||
|
|
15
js/main.js
15
js/main.js
|
@ -470,7 +470,7 @@ function resolveCaptures(point) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function editTerritory(evt) {
|
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);
|
let point = findPointFromIdx(placement);
|
||||||
point.cycleTerritory();
|
point.cycleTerritory();
|
||||||
renderGame();
|
renderGame();
|
||||||
|
@ -580,9 +580,22 @@ function renderGame() {
|
||||||
function renderBoardInit() {
|
function renderBoardInit() {
|
||||||
clearCurrentBoard();
|
clearCurrentBoard();
|
||||||
renderBoardTableRows();
|
renderBoardTableRows();
|
||||||
|
renderHoshi();
|
||||||
renderBoardTableStyle();
|
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() {
|
function clearCurrentBoard() {
|
||||||
boardEl.innerHTML = '';
|
boardEl.innerHTML = '';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue