conflict fix
diff --git a/README.md b/README.md
index f843912..fc1bcdb 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Lottie for Web, [Android](https://github.com/airbnb/lottie-android), [iOS](https://github.com/airbnb/lottie-ios), and [React Native](https://github.com/airbnb/lottie-react-native)
+# Lottie for Web, [Android](https://github.com/airbnb/lottie-android), [iOS](https://github.com/airbnb/lottie-ios), [React Native](https://github.com/airbnb/lottie-react-native), and [Windows](https://aka.ms/lottie)
Lottie is a mobile library for Web, and iOS that parses [Adobe After Effects](http://www.adobe.com/products/aftereffects.html) animations exported as json with [Bodymovin](https://github.com/airbnb/lottie-web) and renders them natively on mobile!
diff --git a/docs/json/helpers/transform.json b/docs/json/helpers/transform.json
index 6de8a14..be60227 100644
--- a/docs/json/helpers/transform.json
+++ b/docs/json/helpers/transform.json
@@ -69,7 +69,7 @@
"$ref": "#/properties/valueKeyframed"
}
],
- "default": {"a":0, "k":0},
+ "default": {"a":0, "k":100},
"type": "object"
},
"px": {
diff --git a/docs/json/shapes/star.json b/docs/json/shapes/star.json
index 4e236fc..c6cb4e2 100644
--- a/docs/json/shapes/star.json
+++ b/docs/json/shapes/star.json
@@ -37,6 +37,32 @@
"type": "object"
},
"ir": {
+ "title": "Inner Radius",
+ "description": "Star's inner radius. (Star only)",
+ "oneOf": [
+ {
+ "$ref": "#/properties/Value"
+ },
+ {
+ "$ref": "#/properties/valueKeyframed"
+ }
+ ],
+ "type": "object"
+ },
+ "is": {
+ "title": "Inner Roundness",
+ "description": "Star's inner roundness. (Star only)",
+ "oneOf": [
+ {
+ "$ref": "#/properties/Value"
+ },
+ {
+ "$ref": "#/properties/valueKeyframed"
+ }
+ ],
+ "type": "object"
+ },
+ "or": {
"title": "Outer Radius",
"description": "Star's outer radius.",
"oneOf": [
@@ -49,7 +75,7 @@
],
"type": "object"
},
- "is": {
+ "os": {
"title": "Outer Roundness",
"description": "Star's outer roundness.",
"oneOf": [
diff --git a/player/index.html b/player/index.html
index 360884f..12ac929 100644
--- a/player/index.html
+++ b/player/index.html
@@ -163,7 +163,7 @@
var elem = document.getElementById('lottie');
var animData = {
container: elem,
- renderer: 'canvas',
+ renderer: 'svg',
loop: false,
autoplay: true,
rendererSettings: {
@@ -174,20 +174,7 @@
path: 'exports/render/data.json'
};
// lottie.setQuality('low');
- setTimeout(()=>{
- anim = lottie.loadAnimation(animData);
- anim.setSubframe(false);
-
- anim.addEventListener('DOMLoaded', function() {
-
- })
-
- setTimeout(()=>{
-
-
- },0)
-
- },0)
+ anim = lottie.loadAnimation(animData);
</script>
</body>
diff --git a/player/js/animation/AnimationItem.js b/player/js/animation/AnimationItem.js
index 851b423..af69bf9 100644
--- a/player/js/animation/AnimationItem.js
+++ b/player/js/animation/AnimationItem.js
@@ -436,7 +436,7 @@
} else {
this.segments.push(arr);
}
- if (this.segments.length) {
+ if (this.segments.length && forceFlag) {
this.adjustSegment(this.segments.shift(), 0);
}
if (this.isPaused) {
diff --git a/player/js/utils/PropertyFactory.js b/player/js/utils/PropertyFactory.js
index eac9500..6e991fc 100644
--- a/player/js/utils/PropertyFactory.js
+++ b/player/js/utils/PropertyFactory.js
@@ -51,7 +51,7 @@
for (k = 0; k < kLen; k += 1) {
newValue[k] = bezierData.points[ind].point[k];
}
- // caching._lastBezierData = null;
+ // caching._lastKeyframeIndex = -1;
} else {
if (keyData.__fnct) {
fnc = keyData.__fnct;
@@ -63,8 +63,8 @@
var distanceInLine = bezierData.segmentLength*perc;
var segmentPerc;
- var addedLength = (caching.lastFrame < frameNum && caching._lastBezierData === bezierData) ? caching._lastAddedLength : 0;
- j = (caching.lastFrame < frameNum && caching._lastBezierData === bezierData) ? caching._lastPoint : 0;
+ var addedLength = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastAddedLength : 0;
+ j = (caching.lastFrame < frameNum && caching._lastKeyframeIndex === i) ? caching._lastPoint : 0;
flag = true;
jLen = bezierData.points.length;
while (flag) {
@@ -91,7 +91,7 @@
}
caching._lastPoint = j;
caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
- caching._lastBezierData = bezierData;
+ caching._lastKeyframeIndex = i;
}
} else {
var outX, outY, inX, inY, keyValue;
@@ -126,11 +126,10 @@
keyData.__fnct = [];
}
if (!keyData.__fnct[i]) {
- outX = (typeof keyData.o.x[i] === undefined) ? keyData.o.x[0] : keyData.o.x[i];
- outY = (typeof keyData.o.y[i] === undefined) ? keyData.o.y[0] : keyData.o.y[i];
- inX = (typeof keyData.i.x[i] === undefined) ? keyData.i.x[0] : keyData.i.x[i];
- inY = (typeof keyData.i.y[i] === undefined) ? keyData.i.y[0] : keyData.i.y[i];
-
+ outX = (typeof keyData.o.x[i] === 'undefined') ? keyData.o.x[0] : keyData.o.x[i];
+ outY = (typeof keyData.o.y[i] === 'undefined') ? keyData.o.y[0] : keyData.o.y[i];
+ inX = (typeof keyData.i.x[i] === 'undefined') ? keyData.i.x[0] : keyData.i.x[i];
+ inY = (typeof keyData.i.y[i] === 'undefined') ? keyData.i.y[0] : keyData.i.y[i];
fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
keyData.__fnct[i] = fnc;
} else {
@@ -237,7 +236,7 @@
var endTime = this.keyframes[this.keyframes.length- 1].t-this.offsetTime;
if(!(frameNum === this._caching.lastFrame || (this._caching.lastFrame !== initFrame && ((this._caching.lastFrame >= endTime && frameNum >= endTime) || (this._caching.lastFrame < initTime && frameNum < initTime))))){
if(this._caching.lastFrame >= frameNum) {
- this._caching._lastBezierData = null;
+ this._caching._lastKeyframeIndex = -1;
this._caching.lastIndex = 0;
}
@@ -348,7 +347,7 @@
this.keyframes = data.k;
this.offsetTime = elem.data.st;
this.frameId = -1;
- this._caching = {lastFrame: initFrame, lastIndex: 0, value: 0, _lastBezierData: null};
+ this._caching = {lastFrame: initFrame, lastIndex: 0, value: 0, _lastKeyframeIndex: -1};
this.k = true;
this.kf = true;
this.data = data;
diff --git a/player/js/utils/expressions/ExpressionManager.js b/player/js/utils/expressions/ExpressionManager.js
index 398ed67..1d6afb1 100644
--- a/player/js/utils/expressions/ExpressionManager.js
+++ b/player/js/utils/expressions/ExpressionManager.js
@@ -26,6 +26,9 @@
}
return retArr;
}
+ if (a.propType) {
+ return a.v;
+ }
}
var easeInBez = BezierFactory.getBezierEasing(0.333,0,.833,.833, 'easeIn').get;
@@ -346,6 +349,11 @@
var transform,$bm_transform,content,effect;
var thisProperty = property;
thisProperty.valueAtTime = thisProperty.getValueAtTime;
+ Object.defineProperty(thisProperty, 'value', {
+ get: function() {
+ return thisProperty.v
+ }
+ })
elem.comp.frameDuration = 1/elem.comp.globalData.frameRate;
elem.comp.displayStartTime = 0;
var inPoint = elem.data.ip/elem.comp.globalData.frameRate;