@esotericsoftware/spine-phaser-v3 4.2.77 → 4.2.79

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.
@@ -14431,6 +14431,17 @@ var BaseSpineGameObject = class extends Phaser.GameObjects.GameObject {
14431
14431
  super(scene, type);
14432
14432
  }
14433
14433
  };
14434
+ var AABBRectangleBoundsProvider = class {
14435
+ constructor(x, y, width, height) {
14436
+ this.x = x;
14437
+ this.y = y;
14438
+ this.width = width;
14439
+ this.height = height;
14440
+ }
14441
+ calculateBounds() {
14442
+ return { x: this.x, y: this.y, width: this.width, height: this.height };
14443
+ }
14444
+ };
14434
14445
  var SetupPoseBoundsProvider = class {
14435
14446
  /**
14436
14447
  * @param clipping If true, clipping attachments are used to compute the bounds. False, by default.
@@ -14543,15 +14554,17 @@ var SpineGameObject = class extends DepthMixin(
14543
14554
  afterUpdateWorldTransforms = () => {
14544
14555
  };
14545
14556
  premultipliedAlpha = false;
14557
+ offsetX = 0;
14558
+ offsetY = 0;
14546
14559
  updateSize() {
14547
14560
  if (!this.skeleton)
14548
14561
  return;
14549
14562
  let bounds = this.boundsProvider.calculateBounds(this);
14550
- let self = this;
14551
- self.width = bounds.width;
14552
- self.height = bounds.height;
14553
- this.displayOriginX = -bounds.x;
14554
- this.displayOriginY = -bounds.y;
14563
+ this.width = bounds.width;
14564
+ this.height = bounds.height;
14565
+ this.setDisplayOrigin(-bounds.x, -bounds.y);
14566
+ this.offsetX = -bounds.x;
14567
+ this.offsetY = -bounds.y;
14555
14568
  }
14556
14569
  /** Converts a point from the skeleton coordinate system to the Phaser world coordinate system. */
14557
14570
  skeletonToPhaserWorldCoordinates(point) {
@@ -14629,15 +14642,17 @@ var SpineGameObject = class extends DepthMixin(
14629
14642
  parentMatrix
14630
14643
  ).calc;
14631
14644
  let a = transform.a, b = transform.b, c = transform.c, d = transform.d, tx = transform.tx, ty = transform.ty;
14645
+ let offsetX = src.offsetX - src.displayOriginX;
14646
+ let offsetY = src.offsetY - src.displayOriginY;
14632
14647
  sceneRenderer.drawSkeleton(
14633
- this.skeleton,
14634
- this.premultipliedAlpha,
14648
+ src.skeleton,
14649
+ src.premultipliedAlpha,
14635
14650
  -1,
14636
14651
  -1,
14637
14652
  (vertices, numVertices, stride) => {
14638
14653
  for (let i = 0; i < numVertices; i += stride) {
14639
- let vx = vertices[i];
14640
- let vy = vertices[i + 1];
14654
+ let vx = vertices[i] + offsetX;
14655
+ let vy = vertices[i + 1] + offsetY;
14641
14656
  vertices[i] = vx * a + vy * c + tx;
14642
14657
  vertices[i + 1] = vx * b + vy * d + ty;
14643
14658
  }
@@ -15221,6 +15236,7 @@ var SpineAtlasFile = class extends Phaser2.Loader.MultiFile {
15221
15236
  window.spine = { SpinePlugin };
15222
15237
  window["spine.SpinePlugin"] = SpinePlugin;
15223
15238
  export {
15239
+ AABBRectangleBoundsProvider,
15224
15240
  Alpha,
15225
15241
  AlphaMixin,
15226
15242
  AlphaTimeline,