@stocksharp/diagram 1.5.1 → 1.5.2

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/dist/ssdiagram.js CHANGED
@@ -2627,15 +2627,17 @@ var SSDiagram = (() => {
2627
2627
  }
2628
2628
  resize(w, h) {
2629
2629
  if (w < 2 || h < 2) return;
2630
+ const dpr = window.devicePixelRatio || 1;
2631
+ if (w === this.width && h === this.height && dpr === this.dpr) return;
2630
2632
  this.width = w;
2631
2633
  this.height = h;
2632
- this.dpr = window.devicePixelRatio || 1;
2634
+ this.dpr = dpr;
2633
2635
  this.canvas.width = Math.round(w * this.dpr);
2634
2636
  this.canvas.height = Math.round(h * this.dpr);
2635
2637
  this.canvas.style.width = `${w}px`;
2636
2638
  this.canvas.style.height = `${h}px`;
2637
2639
  this.ctx.setTransform(this.dpr, 0, 0, this.dpr, 0, 0);
2638
- this.scheduleDraw();
2640
+ if (!this.destroyed) this.draw();
2639
2641
  }
2640
2642
  getInteractionPermissions() {
2641
2643
  return { ...this.permissions };