From 6b1209d34a51246d4339b6eff352d936dc562bd5 Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Mon, 2 Feb 2026 10:07:18 +0100 Subject: [PATCH] Fix setting invalid bounds. --- spine-ts/spine-construct3/src/instance.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spine-ts/spine-construct3/src/instance.ts b/spine-ts/spine-construct3/src/instance.ts index a5f9486b9..a76a5428a 100644 --- a/spine-ts/spine-construct3/src/instance.ts +++ b/spine-ts/spine-construct3/src/instance.ts @@ -467,8 +467,7 @@ class SpineC3PluginInstance extends SDK.IWorldInstanceBase { let { x, y, width, height } = this.spineBounds; _inst.SetOrigin(-x / width, -y / height); - - if (keepScale) { + if (keepScale && oldBoundsWidth !== Infinity && oldBoundsHeight !== Infinity && oldBoundsWidth !== 0 && oldBoundsHeight !== 0) { width *= (_inst.GetWidth() / oldBoundsWidth) * this.propScaleX; height *= (_inst.GetHeight() / oldBoundsHeight) * this.propScaleY; } @@ -492,6 +491,10 @@ class SpineC3PluginInstance extends SDK.IWorldInstanceBase { this.setBoundsFromBoundsProvider(); const { x, y, width, height } = this.spineBounds; + if (width === 0 || height === 0) { + this.spineBoundsInit = true; + return; + } this._inst.SetOrigin(-x / width, -y / height); if (matchesOldBounds) this._inst.SetSize(width, height);