From 5382ef3f3dca9037744911198ee25be481322e96 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Wed, 29 Oct 2025 14:40:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8A=A8=E7=94=BB=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=99=A8=20cycled=20=E7=BB=93=E6=9E=9C=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/render-assets/src/animater.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/render-assets/src/animater.ts b/packages/render-assets/src/animater.ts index 5487b63..7dfef8f 100644 --- a/packages/render-assets/src/animater.ts +++ b/packages/render-assets/src/animater.ts @@ -68,12 +68,13 @@ export class TextureRowAnimater extends FrameBasedAnimater { const h = height / this.frames; let i = 0; while (true) { - if (i === this.frames) i = 0; const renderable: ITextureRenderable = { source: this.texture!.source, rect: this.texture!.clampRect({ x: i * w + ox, y: oy, w, h }) }; yield renderable; + i++; + if (i === this.frames) i = 0; } } } @@ -105,12 +106,13 @@ export class TextureColumnAnimater extends FrameBasedAnimater { const w = width / this.frames; let i = 0; while (true) { - if (i === this.frames) i = 0; const renderable: ITextureRenderable = { source: this.texture!.source, rect: this.texture!.clampRect({ x: i * w + ox, y: oy, w, h }) }; yield renderable; + i++; + if (i === this.frames) i = 0; } } } @@ -202,7 +204,7 @@ export class TextureScanAnimater rect: texture.clampRect({ x: x * w, y: y * h, w, h }) }; yield data; - + index++; if (index === this.frames) index = 0; } }