Skip to content

Commit

Permalink
Fixed centering of AI estimation text
Browse files Browse the repository at this point in the history
  • Loading branch information
anoek committed May 24, 2024
1 parent 4ed7cdd commit 7302d3b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/GobanSVG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1784,7 +1784,11 @@ export class GobanSVG extends GobanCore implements GobanSVGInterface {
text.setAttribute("x", cx.toString());
let yy = cy;
yy -= this.square_size / 6;
yy += this.square_size * 0.6;
if (letter) {
yy += this.square_size * 0.6;
} else {
yy += this.square_size * 0.275;
}
text.setAttribute("y", yy.toString());
text.textContent = subscript;
if (transparent) {
Expand Down
5 changes: 3 additions & 2 deletions src/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ function ReactGoban<GobanClass extends GobanCore>(

let i = 0;
const start = Date.now();
const NUM_MOVES = 300;
//const NUM_MOVES = 20;
//const NUM_MOVES = 300;
const NUM_MOVES = 20;
const interval = setInterval(() => {
i++;
if (i >= NUM_MOVES) {
Expand Down Expand Up @@ -420,6 +420,7 @@ function ReactGoban<GobanClass extends GobanCore>(
goban.setMark(15, 13, "cross", true);
goban.setMark(15, 12, "top", true);
goban.setSubscriptMark(15, 12, "sub", true);
goban.setSubscriptMark(16, 12, "sub", true);
goban.setMark(15, 11, "A", true);

// pen marks
Expand Down

0 comments on commit 7302d3b

Please sign in to comment.