Skip to content

Commit

Permalink
Set SVG renderer to be our default renderer, add option to enable old…
Browse files Browse the repository at this point in the history
… canvas renderer
  • Loading branch information
anoek committed Aug 19, 2024
1 parent f1723e9 commit a01d604
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/lib/configure-goban.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ import { toast } from "toast";
let previous_toast: any = null;

export function configure_goban() {
data.watch("experiments.svg", () => {
const v = data.get("experiments.svg");
data.watch("experiments.canvas", () => {
const v = data.get("experiments.canvas");
if (v === "enabled") {
setGobanRenderer("svg");
} else {
setGobanRenderer("canvas");
} else {
setGobanRenderer("svg");
}
});

Expand Down
10 changes: 5 additions & 5 deletions src/views/Settings/ThemePreferences.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ export function ThemePreferences(): JSX.Element | null {
}
*/

const [svg_enabled, setSvgEnabled] = useData("experiments.svg");
const enable_svg = svg_enabled === "enabled";
const [canvas_enabled, setCanvasEnabled] = useData("experiments.canvas");
const enable_svg = canvas_enabled !== "enabled";

const sample_goban_key =
(enable_svg ? "svg" : "canvas") +
Expand Down Expand Up @@ -420,12 +420,12 @@ export function ThemePreferences(): JSX.Element | null {
</div>
</PreferenceLine>

<PreferenceLine title={"Enable SVG goban renderer"}>
<PreferenceLine title={"Use old canvas goban renderer"}>
<Toggle
checked={enable_svg}
checked={canvas_enabled === "enabled"}
onChange={(tf) => {
//data.set("experiments.svg", tf ? "enabled" : undefined);
setSvgEnabled(tf ? "enabled" : undefined);
setCanvasEnabled(tf ? "enabled" : undefined);
}}
/>
</PreferenceLine>
Expand Down

0 comments on commit a01d604

Please sign in to comment.