cm-chessboard 5.5.12 → 5.5.13

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cm-chessboard",
3
- "version": "5.5.12",
3
+ "version": "5.5.13",
4
4
  "description": "A JavaScript chessboard which is lightweight, ES6 module based, responsive, SVG rendered and without dependencies.",
5
5
  "keywords": [
6
6
  "chess",
@@ -114,12 +114,17 @@ export class RenderVideo extends Extension {
114
114
  }
115
115
 
116
116
  cloneImageAndRender() {
117
+ if(this.rendering) {
118
+ return
119
+ }
120
+ this.rendering = true
117
121
  let serialized = new XMLSerializer().serializeToString(this.chessboard.view.svg)
118
122
  const blob = new Blob([serialized], {type: "image/svg+xml"})
119
123
  const blobURL = URL.createObjectURL(blob)
120
124
  this.image.onload = () => {
121
125
  this.context.drawImage(this.image, 0, 0, this.canvas.width, this.canvas.height, 0, 0, this.canvas.width, this.canvas.height)
122
126
  this.recorder.requestData()
127
+ this.rendering = false
123
128
  }
124
129
  this.image.src = blobURL
125
130
  }