Merge branch 'master' of github.com:bodymovin/bodymovin
diff --git a/player/index.html b/player/index.html
index 94913c6..04cff71 100644
--- a/player/index.html
+++ b/player/index.html
@@ -11,7 +11,7 @@
}
#lottie{
- background-color:#FFF7DC;
+ background-color:#000;
width:100%;
height:100%;
/*width:360px;
@@ -132,8 +132,8 @@
var elem = document.getElementById('lottie')
var animData = {
container: elem,
- renderer: 'svg',
- loop: false,
+ renderer: 'canvas',
+ loop: true,
autoplay: true,
rendererSettings: {
progressiveLoad:false
diff --git a/player/js/animation/AnimationItem.js b/player/js/animation/AnimationItem.js
index 4e21856..7505482 100644
--- a/player/js/animation/AnimationItem.js
+++ b/player/js/animation/AnimationItem.js
@@ -137,7 +137,7 @@
AnimationItem.prototype.includeLayers = function(data) {
if(data.op > this.animationData.op){
this.animationData.op = data.op;
- this.totalFrames = Math.floor(data.op - this.animationData.ip) - 1;
+ this.totalFrames = Math.floor(data.op - this.animationData.ip);
this.animationData.tf = this.totalFrames;
}
var layers = this.animationData.layers;
@@ -223,7 +223,7 @@
//animData.w = Math.round(animData.w/blitter);
//animData.h = Math.round(animData.h/blitter);
this.animationData = animData;
- this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip) - 1;
+ this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
this.animationData.tf = this.totalFrames;
this.renderer.configAnimation(animData);
if(!animData.assets){
@@ -427,9 +427,9 @@
this.setDirection(-1);
}
}
- this.totalFrames = arr[0] - arr[1] - 1;
+ this.totalFrames = arr[0] - arr[1];
this.firstFrame = arr[1];
- this.setCurrentRawFrameValue(this.totalFrames);
+ this.setCurrentRawFrameValue(this.totalFrames - 0.001);
} else if(arr[1] > arr[0]){
if(this.frameModifier < 0){
if(this.playSpeed < 0){
@@ -438,9 +438,9 @@
this.setDirection(1);
}
}
- this.totalFrames = arr[1] - arr[0] - 1;
+ this.totalFrames = arr[1] - arr[0];
this.firstFrame = arr[0];
- this.setCurrentRawFrameValue(0);
+ this.setCurrentRawFrameValue(0.001);
}
this.trigger('segmentStart');
};
@@ -455,7 +455,7 @@
}
this.firstFrame = init;
- this.totalFrames = end - init - 1;
+ this.totalFrames = end - init;
if(pendingFrame !== -1) {
this.goToAndStop(pendingFrame,true);
}
@@ -480,7 +480,8 @@
AnimationItem.prototype.resetSegments = function (forceFlag) {
this.segments.length = 0;
- this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
+ this.segments.push([this.animationData.ip,this.animationData.op]);
+ //this.segments.push([this.animationData.ip*this.frameRate,Math.floor(this.animationData.op - this.animationData.ip+this.animationData.ip*this.frameRate)]);
if(forceFlag){
this.adjustSegment(this.segments.shift());
}
diff --git a/player/js/animation/AnimationManager.js b/player/js/animation/AnimationManager.js
index e7393f0..74a3f59 100644
--- a/player/js/animation/AnimationManager.js
+++ b/player/js/animation/AnimationManager.js
@@ -5,6 +5,7 @@
var len = 0;
var idled = true;
var playingAnimationsNum = 0;
+ var _stopped = true;
function removeElement(ev){
var i = 0;
@@ -95,9 +96,7 @@
registeredAnimations[i].animation.moveFrame(value,animation);
}
}
-
function resume(nowTime) {
-
var elapsedTime = nowTime - initTime;
var i;
for(i=0;i<len;i+=1){
@@ -106,6 +105,8 @@
initTime = nowTime;
if(!idled) {
window.requestAnimationFrame(resume);
+ } else {
+ _stopped = true;
}
}
@@ -188,7 +189,10 @@
function activate(){
if(idled){
idled = false;
- window.requestAnimationFrame(first);
+ if(_stopped) {
+ window.requestAnimationFrame(first);
+ _stopped = false;
+ }
}
}
diff --git a/player/js/elements/canvasElements/CVShapeElement.js b/player/js/elements/canvasElements/CVShapeElement.js
index 7056171..b6a3904 100644
--- a/player/js/elements/canvasElements/CVShapeElement.js
+++ b/player/js/elements/canvasElements/CVShapeElement.js
@@ -440,7 +440,7 @@
this.globalData = null;
this.canvasContext = null;
this.stylesList.length = 0;
- this.itemData.length = 0;
+ this.itemsData.length = 0;
this._parent.destroy.call(this._parent);
};
diff --git a/player/js/utils/expressions/ShapeInterface.js b/player/js/utils/expressions/ShapeInterface.js
index 08156fa..545c830 100644
--- a/player/js/utils/expressions/ShapeInterface.js
+++ b/player/js/utils/expressions/ShapeInterface.js
@@ -595,7 +595,7 @@
if(shape.r.ix === value){
return interfaceFunction.roundness;
}
- if(shape.s.ix === value || value === 'Size'){
+ if(shape.s.ix === value || value === 'Size' || value === 'ADBE Vector Rect Size'){
return interfaceFunction.size;
}