From a80f9aad26cca46f1a999ae860e35c1fac8d6654 Mon Sep 17 00:00:00 2001 From: samuelOsborne Date: Sun, 20 Jun 2021 17:46:40 +0200 Subject: [PATCH] fix(Morphing Interactions): Fixed morphing interactions restarting on second half, bumped version --- package.json | 2 +- src/index.ts | 3 +-- src/interactions/morph-lock.ts | 3 +-- src/interactions/morph.ts | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index b10de9b..850bbbb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lottie-interactive", - "version": "1.2.4", + "version": "1.3.0", "description": "A custom element that adds interactions and quality of life changes to Lottie animations.", "main": "dist/lottie-interactive.js", "types": "./types/lottie.d.ts", diff --git a/src/index.ts b/src/index.ts index 603c68d..6c66745 100644 --- a/src/index.ts +++ b/src/index.ts @@ -240,10 +240,9 @@ export class LottieInteractive extends FASTElement { private data: any; /** - * Array of all the possible interactions + * The currently used interaction on the animation * @private */ - //private interactions: Array; private currentInteraction: BaseInteraction; /** diff --git a/src/interactions/morph-lock.ts b/src/interactions/morph-lock.ts index 0f8e7b9..aa3a6b6 100644 --- a/src/interactions/morph-lock.ts +++ b/src/interactions/morph-lock.ts @@ -40,13 +40,12 @@ export class MorphLock extends BaseInteraction { this.direction = 1; this.playing = true; this.lottiePlayer.setDirection(this.direction); - this.lottiePlayer.goToAndPlay(0, true); } else if (this.direction === 1) { this.direction = -1; this.playing = true; this.lottiePlayer.setDirection(this.direction); - this.lottiePlayer.play(); } + this.lottiePlayer.play(); } public playOnHover(): void { diff --git a/src/interactions/morph.ts b/src/interactions/morph.ts index a5f807d..e07a728 100644 --- a/src/interactions/morph.ts +++ b/src/interactions/morph.ts @@ -31,13 +31,12 @@ export class Morph extends BaseInteraction { this.direction = 1; this.playing = true; this.lottiePlayer.setDirection(this.direction); - this.lottiePlayer.goToAndPlay(0, true); } else if (this.direction === 1) { this.direction = -1; this.playing = true; this.lottiePlayer.setDirection(this.direction); - this.lottiePlayer.play(); } + this.lottiePlayer.play(); } public playOnHover(): void {