cm-chessboard 8.12.0 → 8.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -43,6 +43,7 @@ export class Arrows extends Extension {
|
|
|
43
43
|
chessboard.getArrows = this.getArrows.bind(this)
|
|
44
44
|
chessboard.removeArrows = this.removeArrows.bind(this)
|
|
45
45
|
this.arrowGroup = Svg.addElement(chessboard.view.markersTopLayer, "g", {class: "arrows"})
|
|
46
|
+
this.instanceId = Math.random().toString(36).slice(2, 10)
|
|
46
47
|
this.arrows = []
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -74,7 +75,7 @@ export class Arrows extends Extension {
|
|
|
74
75
|
const ptTo = view.squareToPoint(arrow.to)
|
|
75
76
|
const spriteUrl = this.chessboard.props.assetsCache ? "" : this.getSpriteUrl()
|
|
76
77
|
const defs = Svg.addElement(arrowsGroup, "defs")
|
|
77
|
-
const id = "arrow-" + arrow.from + arrow.to
|
|
78
|
+
const id = "arrow-" + this.instanceId + "-" + arrow.from + arrow.to
|
|
78
79
|
const marker = Svg.addElement(defs, "marker", {
|
|
79
80
|
id: id,
|
|
80
81
|
markerWidth: this.props.headSize,
|