diff --git a/package-lock.json b/package-lock.json index 214678e..b6816e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pixijs-actions", - "version": "1.2.2", + "version": "1.2.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "pixijs-actions", - "version": "1.2.2", + "version": "1.2.3", "license": "MIT", "devDependencies": { "@types/jest": "^29.2.6", diff --git a/package.json b/package.json index 1585414..1587db5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixijs-actions", - "version": "1.2.2", + "version": "1.2.3", "author": "Reece Como ", "authors": [ "Reece Como ", diff --git a/src/__tests__/Action.test.ts b/src/__tests__/Action.test.ts index f066088..d100cfa 100644 --- a/src/__tests__/Action.test.ts +++ b/src/__tests__/Action.test.ts @@ -404,6 +404,23 @@ describe('Action Chaining', () => { node.removeAllActions(); }); + it('loops correctly with scaleTo (regression case)', () => { + const node = new Container(); + node.run(Action.repeatForever(Action.sequence([ + Action.scaleTo(0.9, 1.0).easeInOut(), + Action.scaleTo(10, 1.0).easeInOut(), + ]))); + + simulateTime(1.0); + expect(node.scale.x).toBeCloseTo(0.9); + + simulateTime(1.0); + expect(node.scale.x).toBeCloseTo(10); + + simulateTime(0.1, 1); + expect(node.scale.x).toBeGreaterThan(9.5); + }); + it('should loop over a group', () => { const group = Action.group([ Action.moveByX(5, 1.0), diff --git a/src/lib/ActionTicker.ts b/src/lib/ActionTicker.ts index 44cef59..bce4c72 100644 --- a/src/lib/ActionTicker.ts +++ b/src/lib/ActionTicker.ts @@ -284,6 +284,7 @@ export class ActionTicker { public reset(): void { this._elapsed = 0.0; this.isDone = false; + this._isSetup = false; (this.action as any).onTickerDidReset(this); } }