diff --git a/src/core/SpriteAnimator.tsx b/src/core/SpriteAnimator.tsx index ce93eaff7..3360cefc1 100644 --- a/src/core/SpriteAnimator.tsx +++ b/src/core/SpriteAnimator.tsx @@ -228,16 +228,16 @@ export const SpriteAnimator = /* @__PURE__ */ React.forwardRef= _endFrame if (endCondition) { - currentFrame.current = loop ? startFrame ?? 0 : 0 + currentFrame.current = loop ? (startFrame ?? 0) : 0 if (playBackwards) { currentFrame.current = _endFrame @@ -378,12 +378,12 @@ export const SpriteAnimator = /* @__PURE__ */ React.forwardRef 0 ? frameOffsetX * (frameX / originalSizeX) : frameOffsetX * (frameX / originalSizeX) - matRef.current.map.repeat.x + flipOffset > 0 + ? frameOffsetX * (frameX / originalSizeX) + : frameOffsetX * (frameX / originalSizeX) - matRef.current.map.repeat.x finalValY = Math.abs(1 - frameOffsetY) - frameOffsetY * (frameY / originalSizeY) matRef.current.map.offset.x = finalValX @@ -489,7 +491,7 @@ export const SpriteAnimator = /* @__PURE__ */ React.forwardRef {(instanceItems ?? [0]).map((item, index) => ( - + ))} )}