Skip to content

Commit 03f8f67

Browse files
committed
[ts][player] Calculates animation viewport using new Skeleton.getBounds that considers clipping.
1 parent f309722 commit 03f8f67

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spine-ts/spine-player/src/Player.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -771,10 +771,11 @@ export class SpinePlayer implements Disposable {
771771
let minX = 100000000, maxX = -100000000, minY = 100000000, maxY = -100000000;
772772
let offset = new Vector2(), size = new Vector2();
773773

774+
const tempArray = new Array<number>(2);
774775
for (let i = 0; i < steps; i++, time += stepTime) {
775776
animation.apply(this.skeleton!, time, time, false, [], 1, MixBlend.setup, MixDirection.mixIn);
776777
this.skeleton!.updateWorldTransform(Physics.update);
777-
this.skeleton!.getBounds(offset, size);
778+
this.skeleton!.getBounds(offset, size, tempArray, this.sceneRenderer!.skeletonRenderer.getSkeletonClipping());
778779

779780
if (!isNaN(offset.x) && !isNaN(offset.y) && !isNaN(size.x) && !isNaN(size.y)) {
780781
minX = Math.min(offset.x, minX);

0 commit comments

Comments
 (0)