Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Svg optimizations #175

Merged
merged 9 commits into from
Sep 4, 2024
2 changes: 1 addition & 1 deletion engine/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "goban-engine",
"version": "8.3.31",
"version": "8.3.32",
"description": "",
"main": "build/goban-engine.js",
"types": "build/engine/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions examples/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ try {
Goban.setCallbacks({
getSelectedThemes: () => ({
"board": "Kaya",
//board: "Anime",
//"board": "Anime",

"white": "Plain",
"black": "Plain",
Expand Down Expand Up @@ -376,8 +376,8 @@ function ReactGoban<GobanClass extends Goban>(

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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "goban",
"version": "8.3.31",
"version": "8.3.32",
"description": "",
"main": "build/goban.js",
"types": "build/src/index.d.ts",
Expand Down
10 changes: 0 additions & 10 deletions src/Goban.styl
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,6 @@
box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.16);
}
}

/* SVG */
svg {
text {
font-family: Verdana, Arial, sans-serif;
text-anchor: middle;
font-weight: bold;
user-select: none;
}
}
}


2 changes: 1 addition & 1 deletion src/Goban/Goban.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export abstract class Goban extends OGSConnectivity {

protected abstract setTheme(themes: GobanSelectedThemes, dont_redraw: boolean): void;

protected parent!: HTMLElement;
public parent!: HTMLElement;
private analysis_scoring_color?: "black" | "white" | string;
private analysis_scoring_last_position: { i: number; j: number } = { i: NaN, j: NaN };

Expand Down
6 changes: 3 additions & 3 deletions src/Goban/InteractiveBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ export abstract class GobanInteractive extends GobanBase {
protected display_width?: number;
protected done_loading_review: boolean = false;
protected dont_draw_last_move: boolean;
protected last_move_radius: number;
protected circle_radius: number;
public last_move_radius: number;
public circle_radius: number;
protected edit_color?: "black" | "white";
protected errorHandler: (e: Error) => void;
protected heatmap?: NumberMatrix;
Expand Down Expand Up @@ -274,7 +274,7 @@ export abstract class GobanInteractive extends GobanBase {
protected shift_key_is_down: boolean;
//protected show_move_numbers: boolean;
protected show_variation_move_numbers: boolean;
protected square_size: number = 10;
public square_size: number = 10;
protected stone_placement_enabled: boolean;
protected sendLatencyTimer?: ReturnType<typeof niceInterval>;

Expand Down
Loading
Loading