mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[ts][player] Calculates animation viewport using new Skeleton.getBounds that considers clipping.
This commit is contained in:
parent
f3097222f9
commit
03f8f67e01
@ -771,10 +771,11 @@ export class SpinePlayer implements Disposable {
|
||||
let minX = 100000000, maxX = -100000000, minY = 100000000, maxY = -100000000;
|
||||
let offset = new Vector2(), size = new Vector2();
|
||||
|
||||
const tempArray = new Array<number>(2);
|
||||
for (let i = 0; i < steps; i++, time += stepTime) {
|
||||
animation.apply(this.skeleton!, time, time, false, [], 1, MixBlend.setup, MixDirection.mixIn);
|
||||
this.skeleton!.updateWorldTransform(Physics.update);
|
||||
this.skeleton!.getBounds(offset, size);
|
||||
this.skeleton!.getBounds(offset, size, tempArray, this.sceneRenderer!.skeletonRenderer.getSkeletonClipping());
|
||||
|
||||
if (!isNaN(offset.x) && !isNaN(offset.y) && !isNaN(size.x) && !isNaN(size.y)) {
|
||||
minX = Math.min(offset.x, minX);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user