Skip to content

Commit

Permalink
Reduce size of shadow circle to get rid of glowing white ring around …
Browse files Browse the repository at this point in the history
…shell stones that is visible at some sizes
  • Loading branch information
anoek committed Aug 24, 2024
1 parent 21a80bc commit 01e3f25
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
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.27",
"version": "8.3.29",
"description": "",
"main": "build/goban-engine.js",
"types": "build/engine/index.d.ts",
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.27",
"version": "8.3.29",
"description": "",
"main": "build/goban.js",
"types": "build/src/index.d.ts",
Expand Down
18 changes: 9 additions & 9 deletions src/Goban/themes/GobanTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,24 +192,24 @@ export class GobanTheme {
return;
}

const invisible_circle_to_cast_shadow = document.createElementNS(
const circle_to_cast_shadow = document.createElementNS(
"http://www.w3.org/2000/svg",
"circle",
);
invisible_circle_to_cast_shadow.setAttribute("class", "shadow");
invisible_circle_to_cast_shadow.setAttribute("fill", color);
invisible_circle_to_cast_shadow.setAttribute("cx", cx.toString());
invisible_circle_to_cast_shadow.setAttribute("cy", cy.toString());
invisible_circle_to_cast_shadow.setAttribute("r", (radius * 0.97).toString());
circle_to_cast_shadow.setAttribute("class", "shadow");
circle_to_cast_shadow.setAttribute("fill", color);
circle_to_cast_shadow.setAttribute("cx", cx.toString());
circle_to_cast_shadow.setAttribute("cy", cy.toString());
circle_to_cast_shadow.setAttribute("r", (radius * 0.9).toString());
const sx = radius * 0.15;
const sy = radius * 0.15;
const softness = radius * 0.1;
invisible_circle_to_cast_shadow.setAttribute(
circle_to_cast_shadow.setAttribute(
"style",
`filter: drop-shadow(${sx}px ${sy}px ${softness}px rgba(0,0,0,0.4)`,
);
shadow_cell.appendChild(invisible_circle_to_cast_shadow);
return invisible_circle_to_cast_shadow;
shadow_cell.appendChild(circle_to_cast_shadow);
return circle_to_cast_shadow;
}

private placeStoneSVG(
Expand Down

0 comments on commit 01e3f25

Please sign in to comment.