Skip to content

Commit ccfb173

Browse files
committed
Be lazier about creating our intersection g element (don't do on omnipresent transform)
1 parent 8322050 commit ccfb173

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Goban/SVGRenderer.ts

+8
Original file line numberDiff line numberDiff line change
@@ -4611,6 +4611,9 @@ class GCell {
46114611
public get g(): SVGGraphicsElement {
46124612
if (!this._g) {
46134613
this._g = document.createElementNS("http://www.w3.org/2000/svg", "g");
4614+
if (this._transform) {
4615+
this.g.setAttribute("transform", this._transform);
4616+
}
46144617
this.renderer.grid_layer!.appendChild(this._g);
46154618
}
46164619
return this._g;
@@ -4623,6 +4626,11 @@ class GCell {
46234626

46244627
this._transform = transform;
46254628

4629+
if (!this._g) {
4630+
// be lazy if we haven't already created the g element
4631+
return;
4632+
}
4633+
46264634
this.g.setAttribute("transform", transform);
46274635

46284636
if (this.last_stone_shadow) {

0 commit comments

Comments
 (0)