@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.
@@ -2565,15 +2565,17 @@ var SSDiagramHeadless = (() => {
2565
2565
  }
2566
2566
  resize(w, h) {
2567
2567
  if (w < 2 || h < 2) return;
2568
+ const dpr = window.devicePixelRatio || 1;
2569
+ if (w === this.width && h === this.height && dpr === this.dpr) return;
2568
2570
  this.width = w;
2569
2571
  this.height = h;
2570
- this.dpr = window.devicePixelRatio || 1;
2572
+ this.dpr = dpr;
2571
2573
  this.canvas.width = Math.round(w * this.dpr);
2572
2574
  this.canvas.height = Math.round(h * this.dpr);
2573
2575
  this.canvas.style.width = `${w}px`;
2574
2576
  this.canvas.style.height = `${h}px`;
2575
2577
  this.ctx.setTransform(this.dpr, 0, 0, this.dpr, 0, 0);
2576
- this.scheduleDraw();
2578
+ if (!this.destroyed) this.draw();
2577
2579
  }
2578
2580
  getInteractionPermissions() {
2579
2581
  return { ...this.permissions };