diff --git a/src/elements/animate-adobe-control.js b/src/elements/animate-adobe-control.js index dc7fc0e..bdc412f 100644 --- a/src/elements/animate-adobe-control.js +++ b/src/elements/animate-adobe-control.js @@ -8,7 +8,10 @@ export class AnimateAdobeControl { console.log('animateadobecontrol startstop()', this); this.animationstarted = ! this.animationstarted; let eventname; - if (this.animationstarted) eventname = 'animatestart'; + if (this.animationstarted) { + if (window.ani) window.ani.enableAnimation(); + eventname = 'animatestart'; + } else eventname = 'animatestop'; let event = new CustomEvent(eventname, {detail: {time: this.frame}}); //send start signal on frame 0 //dispatch event - it should be listened by some other component diff --git a/src/elements/animate-adobe.js b/src/elements/animate-adobe.js index cf2fdb4..605881d 100644 --- a/src/elements/animate-adobe.js +++ b/src/elements/animate-adobe.js @@ -183,7 +183,7 @@ export class AnimateAdobe { if (window.ani && window.ani.animobjs) window.ani.animobjs = null; if (window.ani && window.ani.textobjs) window.ani.textobjs = null; if (window.ani && window.ani.playobjs) window.ani.playobjs = null; - if (window.AdobeAn) window.AdobeAn = null; + //if (window.AdobeAn) window.AdobeAn = null; } removeScript(source) { diff --git a/src/elements/animate-control.js b/src/elements/animate-control.js index cbaf122..3927aad 100644 --- a/src/elements/animate-control.js +++ b/src/elements/animate-control.js @@ -104,6 +104,7 @@ export class AnimateControl { document.getElementById(this.id).dispatchEvent(event); } else { //this.animationstarted = true; + if (window.ani) window.ani.enableAnimation(); let that = this; //console.log('startstop() animate using requestAnimationFrame'); //animate using requestAnimationFrame @@ -188,6 +189,7 @@ export class AnimateControl { this.astep = adif / sdif; } //console.log('BdlAnimateControl segment() astep', this.astep); + if (window.ani) window.ani.enableAnimation(); let event = new CustomEvent(this.eventprefix + 'start', {detail: {time: this.frame}}); document.getElementById(this.id).dispatchEvent(event); } diff --git a/src/elements/bind2animation.js b/src/elements/bind2animation.js index d456197..e544225 100644 --- a/src/elements/bind2animation.js +++ b/src/elements/bind2animation.js @@ -42,7 +42,7 @@ export class Bind2animation { if (this.autofmin) { //initially sets minimum as 1/2 of current value, otherwise update it if (!this.afminset) { - this.fmin = x/2; + this.fmin = x*0.9; this.afminset = true; this.updateK(); } else { @@ -58,7 +58,7 @@ export class Bind2animation { if (this.autofmax) { //initially sets maximum as 2x of current value, otherwise update it if (!this.afmaxset) { - this.fmax = x*2; + this.fmax = x*1.1; this.afmaxset = true; this.updateK(); } else { @@ -74,6 +74,7 @@ export class Bind2animation { } updateK() { + console.log('bind2animation updateK() aname'+this.aname+' min:'+ this.fmin+ ' max:'+this.fmax); this.k1 = (this.fmax !== this.fmin) ? (1 / (this.fmax - this.fmin)) : 0; this.k2 = (this.fmax !== this.fmin) ? (this.fmin / (this.fmax - this.fmin)) : 0; }