Merge branch 'master' of github.com:airbnb/lottie-web
diff --git a/index.d.ts b/index.d.ts
index c1549d1..29be0b9 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -53,6 +53,13 @@
className?: string;
};
+export type FilterSize = {
+ width: number;
+ height: number;
+ x: number;
+ y: number;
+};
+
export type SVGRendererConfig = BaseRendererConfig & {
title?: string;
description?: string;
@@ -62,6 +69,7 @@
viewBoxOnly?: boolean;
viewBoxSize?: string;
focusable?: boolean;
+ filterSize?: FilterSize;
};
export type CanvasRendererConfig = BaseRendererConfig & {
@@ -83,6 +91,7 @@
initialSegment?: AnimationSegment;
name?: string;
assetsPath?: string;
+ initialSegment: AnimationSegment;
rendererSettings?: SVGRendererConfig | CanvasRendererConfig | HTMLRendererConfig;
}
diff --git a/player/index.html b/player/index.html
index e0caf7c..55dab93 100644
--- a/player/index.html
+++ b/player/index.html
@@ -172,10 +172,10 @@
var animData = {
container: elem,
renderer: 'svg',
- loop: true,
+ loop: 3,
autoplay: true,
rendererSettings: {
- progressiveLoad:true,
+ progressiveLoad:false,
preserveAspectRatio: 'xMidYMid meet',
imagePreserveAspectRatio: 'xMidYMid meet',
title: 'TEST TITLE',
@@ -190,8 +190,9 @@
path: 'exports/render/data.json',
};
// lottie.setQuality('low');
+ // anim.setSpeed(0.5)
anim = lottie.loadAnimation(animData);
- // anim.setSubframe(false);
+ anim.setSubframe(false);
anim.onError = function(errorType, nativeError, errorProps) {
console.log(errorType)
}
diff --git a/player/js/animation/AnimationItem.js b/player/js/animation/AnimationItem.js
index 1c33a74..78a0053 100644
--- a/player/js/animation/AnimationItem.js
+++ b/player/js/animation/AnimationItem.js
@@ -33,9 +33,6 @@
extendPrototype([BaseEvent], AnimationItem);
AnimationItem.prototype.setParams = function(params) {
- if(params.context){
- this.context = params.context;
- }
if(params.wrapper || params.container){
this.wrapper = params.wrapper || params.container;
}
diff --git a/player/js/utils/shapes/TrimModifier.js b/player/js/utils/shapes/TrimModifier.js
index a5df938..0290b50 100644
--- a/player/js/utils/shapes/TrimModifier.js
+++ b/player/js/utils/shapes/TrimModifier.js
@@ -108,6 +108,9 @@
this.shapes[i].localShapeCollection.releaseShapes();
this.shapes[i].shape._mdf = true;
this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
+ if (this._mdf) {
+ this.shapes[i].pathsData.length = 0;
+ }
}
} else if (!((e === 1 && s === 0) || (e===0 && s === 1))){
var segments = [], shapeData, localShapeCollection;