@voicenter-team/opensips-js 1.0.114 → 1.0.116

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.
@@ -82372,16 +82372,19 @@ class Ub {
82372
82372
  }
82373
82373
  addImage(e, t) {
82374
82374
  console.log("this.stage.width()", this.stage.width()), console.log("this.stage.height()", this.stage.height()), console.log("imageObj.width", t.width), console.log("imageObj.height", t.height);
82375
- const n = new Tc.Image({
82375
+ let n, i;
82376
+ const s = t.width / t.height;
82377
+ this.stage.width() < t.width ? (n = this.stage.width(), i = this.stage.width() / s) : (n = t.width, i = t.width / s), console.log("imageWidth", n), console.log("imageHeight", i);
82378
+ const a = new Tc.Image({
82376
82379
  image: t,
82377
- x: (this.stage.width() - t.width) / 2,
82378
- // Center horizontally
82379
- y: (this.stage.height() - t.height) / 2,
82380
- // Center vertically
82381
- width: this.stage.width() < t.width ? this.stage.width() : t.width,
82382
- height: this.stage.height() < t.height ? this.stage.height() : t.height
82380
+ x: (this.stage.width() - n) / 2,
82381
+ //(this.stage.width() - imageObj.width) / 2, // Center horizontally
82382
+ y: (this.stage.height() - i) / 2,
82383
+ //(this.stage.height() - imageObj.height) / 2, // Center vertically
82384
+ width: n,
82385
+ height: i
82383
82386
  });
82384
- return e.add(n), n;
82387
+ return e.add(a), a;
82385
82388
  }
82386
82389
  // Hack to make the drawings visible after canvas resize
82387
82390
  addWakeupLine(e) {