supporting dynamic properties for shape properties
diff --git a/package-lock.json b/package-lock.json
index a61efba..0ed2722 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "lottie-web",
- "version": "5.1.7",
+ "version": "5.1.10",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/player/index.html b/player/index.html
index 9c7565b..9c27205 100644
--- a/player/index.html
+++ b/player/index.html
@@ -12,7 +12,7 @@
}
#lottie{
- background-color:#ccc;
+ background-color:#000;
width:100%;
height:100%;
/*width:600px;
@@ -58,9 +58,8 @@
}
</style>
- <script src="lottie_api.js"></script>
<!-- build:js lottie.js -->
- <script src="js/main.js"></script>
+ <script src="js/main.js"></script>
<script src="js/utils/common.js"></script>
<script src="js/utils/BaseEvent.js"></script>
<script src="js/utils/helpers/arrays.js"></script>
@@ -200,18 +199,19 @@
rendererSettings: {
progressiveLoad:false,
},
- path: 'exports/render/LottieLogo2.json'
+ path: 'exports/render/data.json'
};
anim = lottie.loadAnimation(animData);
+ // anim.setSubframe(false);
- anim.addEventListener('DOMLoaded', function() {
+ /*anim.addEventListener('DOMLoaded', function() {
animationAPI = lottie_api.createAnimationApi(anim);
var null_animator = animationAPI.getKeyPath('Shape Layer 2, Transform, Scale');
animationAPI.addValueCallback(null_animator, function(currentValue) {
currentValue[0] = Math.random() * 100;
return currentValue
})
- })
+ })*/
//anim.setSubframe(false);
</script>
</body>
diff --git a/player/js/EffectsManager.js b/player/js/EffectsManager.js
index 2af731d..bec6706 100644
--- a/player/js/EffectsManager.js
+++ b/player/js/EffectsManager.js
@@ -10,8 +10,6 @@
}
function GroupEffect(data,element){
- this.container = element;
- this.dynamicProperties = [];
this.init(data,element);
}
@@ -21,8 +19,8 @@
GroupEffect.prototype.init = function(data,element){
this.data = data;
- this._mdf = false;
this.effectElements = [];
+ this.initDynamicPropertyContainer(element);
var i, len = this.data.ef.length;
var eff, effects = this.data.ef;
for(i=0;i<len;i+=1){
diff --git a/player/js/elements/BaseElement.js b/player/js/elements/BaseElement.js
index 2ee0e43..23ec18b 100644
--- a/player/js/elements/BaseElement.js
+++ b/player/js/elements/BaseElement.js
@@ -1,82 +1,79 @@
function BaseElement(){
}
-BaseElement.prototype.checkMasks = function(){
- if(!this.data.hasMask){
- return false;
- }
- var i = 0, len = this.data.masksProperties.length;
- while(i<len) {
- if((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
- return true;
+
+BaseElement.prototype = {
+ checkMasks: function(){
+ if(!this.data.hasMask){
+ return false;
}
- i += 1;
+ var i = 0, len = this.data.masksProperties.length;
+ while(i<len) {
+ if((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
+ return true;
+ }
+ i += 1;
+ }
+ return false;
+ },
+ initExpressions: function(){
+ this.layerInterface = LayerExpressionInterface(this);
+ if(this.data.hasMask && this.maskManager) {
+ this.layerInterface.registerMaskInterface(this.maskManager);
+ }
+ var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);
+ this.layerInterface.registerEffectsInterface(effectsInterface);
+
+ if(this.data.ty === 0 || this.data.xt){
+ this.compInterface = CompExpressionInterface(this);
+ } else if(this.data.ty === 4){
+ this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface);
+ this.layerInterface.content = this.layerInterface.shapeInterface;
+ } else if(this.data.ty === 5){
+ this.layerInterface.textInterface = TextExpressionInterface(this);
+ this.layerInterface.text = this.layerInterface.textInterface;
+ }
+ },
+ blendModeEnums: {
+ 1:'multiply',
+ 2:'screen',
+ 3:'overlay',
+ 4:'darken',
+ 5:'lighten',
+ 6:'color-dodge',
+ 7:'color-burn',
+ 8:'hard-light',
+ 9:'soft-light',
+ 10:'difference',
+ 11:'exclusion',
+ 12:'hue',
+ 13:'saturation',
+ 14:'color',
+ 15:'luminosity'
+ },
+ getBlendMode: function(){
+ return this.blendModeEnums[this.data.bm] || '';
+ },
+ setBlendMode: function(){
+ var blendModeValue = this.getBlendMode();
+ var elem = this.baseElement || this.layerElement;
+
+ elem.style['mix-blend-mode'] = blendModeValue;
+ },
+ initBaseData: function(data, globalData, comp){
+ this.globalData = globalData;
+ this.comp = comp;
+ this.data = data;
+ this.layerId = 'ly_'+randomString(10);
+
+ //Stretch factor for old animations missing this property.
+ if(!this.data.sr){
+ this.data.sr = 1;
+ }
+ // effects manager
+ this.effectsManager = new EffectsManager(this.data,this,this.dynamicProperties);
+
+ },
+ getType: function(){
+ return this.type;
}
- return false;
-};
-
-BaseElement.prototype.initExpressions = function(){
- this.layerInterface = LayerExpressionInterface(this);
- if(this.data.hasMask && this.maskManager) {
- this.layerInterface.registerMaskInterface(this.maskManager);
- }
- var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this,this.layerInterface);
- this.layerInterface.registerEffectsInterface(effectsInterface);
-
- if(this.data.ty === 0 || this.data.xt){
- this.compInterface = CompExpressionInterface(this);
- } else if(this.data.ty === 4){
- this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData,this.itemsData,this.layerInterface);
- this.layerInterface.content = this.layerInterface.shapeInterface;
- } else if(this.data.ty === 5){
- this.layerInterface.textInterface = TextExpressionInterface(this);
- this.layerInterface.text = this.layerInterface.textInterface;
- }
-};
-
-BaseElement.prototype.blendModeEnums = {
- 1:'multiply',
- 2:'screen',
- 3:'overlay',
- 4:'darken',
- 5:'lighten',
- 6:'color-dodge',
- 7:'color-burn',
- 8:'hard-light',
- 9:'soft-light',
- 10:'difference',
- 11:'exclusion',
- 12:'hue',
- 13:'saturation',
- 14:'color',
- 15:'luminosity'
-};
-
-BaseElement.prototype.getBlendMode = function(){
- return this.blendModeEnums[this.data.bm] || '';
-};
-
-BaseElement.prototype.setBlendMode = function(){
- var blendModeValue = this.getBlendMode();
- var elem = this.baseElement || this.layerElement;
-
- elem.style['mix-blend-mode'] = blendModeValue;
-};
-
-BaseElement.prototype.initBaseData = function(data, globalData, comp){
- this.globalData = globalData;
- this.comp = comp;
- this.data = data;
- this.layerId = 'ly_'+randomString(10);
-
- //Stretch factor for old animations missing this property.
- if(!this.data.sr){
- this.data.sr = 1;
- }
- // effects manager
- this.effectsManager = new EffectsManager(this.data,this,this.dynamicProperties);
-
-};
-
-BaseElement.prototype.getType = function(){
- return this.type;
-};
+}
\ No newline at end of file
diff --git a/player/js/elements/helpers/shapes/SVGFillStyleData.js b/player/js/elements/helpers/shapes/SVGFillStyleData.js
index 72457e8..3ec2644 100644
--- a/player/js/elements/helpers/shapes/SVGFillStyleData.js
+++ b/player/js/elements/helpers/shapes/SVGFillStyleData.js
@@ -1,6 +1,9 @@
function SVGFillStyleData(elem, data, styleOb){
- this.o = PropertyFactory.getProp(elem,data.o,0,0.01,elem);
- this.c = PropertyFactory.getProp(elem,data.c,1,255,elem);
- this._isAnimated = this.o.effectsSequence.length || this.c.effectsSequence.length;
+ this.initDynamicPropertyContainer(elem);
+ this.getValue = this.iterateDynamicProperties;
+ this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
+ this.c = PropertyFactory.getProp(elem,data.c,1,255,this);
this.style = styleOb;
-}
\ No newline at end of file
+}
+
+extendPrototype([DynamicPropertyContainer], SVGFillStyleData);
\ No newline at end of file
diff --git a/player/js/elements/helpers/shapes/SVGGradientFillStyleData.js b/player/js/elements/helpers/shapes/SVGGradientFillStyleData.js
index 1d246f5..dd485fb 100644
--- a/player/js/elements/helpers/shapes/SVGGradientFillStyleData.js
+++ b/player/js/elements/helpers/shapes/SVGGradientFillStyleData.js
@@ -1,25 +1,21 @@
function SVGGradientFillStyleData(elem, data, styleOb){
+ this.initDynamicPropertyContainer(elem);
+ this.getValue = this.iterateDynamicProperties;
this.initGradientData(elem, data, styleOb);
}
SVGGradientFillStyleData.prototype.initGradientData = function(elem, data, styleOb){
- this.o = PropertyFactory.getProp(elem,data.o,0,0.01,elem);
- this.s = PropertyFactory.getProp(elem,data.s,1,null,elem);
- this.e = PropertyFactory.getProp(elem,data.e,1,null,elem);
- this.h = PropertyFactory.getProp(elem,data.h||{k:0},0,0.01,elem);
- this.a = PropertyFactory.getProp(elem,data.a||{k:0},0,degToRads,elem);
- this.g = new GradientProperty(elem,data.g,elem);
+ this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
+ this.s = PropertyFactory.getProp(elem,data.s,1,null,this);
+ this.e = PropertyFactory.getProp(elem,data.e,1,null,this);
+ this.h = PropertyFactory.getProp(elem,data.h||{k:0},0,0.01,this);
+ this.a = PropertyFactory.getProp(elem,data.a||{k:0},0,degToRads,this);
+ this.g = new GradientProperty(elem,data.g,this);
this.style = styleOb;
this.stops = [];
this.setGradientData(styleOb.pElem, data);
this.setGradientOpacity(data, styleOb);
- this._isAnimated = !!this._isAnimated
- || this.o.effectsSequence.length
- || this.s.effectsSequence.length
- || this.e.effectsSequence.length
- || this.h.effectsSequence.length
- || this.a.effectsSequence.length
- || this.g.prop.effectsSequence.length;
+ this._isAnimated = !!this._isAnimated;
};
@@ -72,4 +68,6 @@
this.maskId = maskId;
styleOb.msElem = maskElement;
}
-};
\ No newline at end of file
+};
+
+extendPrototype([DynamicPropertyContainer], SVGGradientFillStyleData);
\ No newline at end of file
diff --git a/player/js/elements/helpers/shapes/SVGGradientStrokeStyleData.js b/player/js/elements/helpers/shapes/SVGGradientStrokeStyleData.js
index 9b63b49..9cf09a0 100644
--- a/player/js/elements/helpers/shapes/SVGGradientStrokeStyleData.js
+++ b/player/js/elements/helpers/shapes/SVGGradientStrokeStyleData.js
@@ -1,12 +1,10 @@
function SVGGradientStrokeStyleData(elem, data, styleOb){
- this.w = PropertyFactory.getProp(elem,data.w,0,null,elem);
- this.d = new DashProperty(elem,data.d||{},'svg',elem);
+ this.initDynamicPropertyContainer(elem);
+ this.getValue = this.iterateDynamicProperties;
+ this.w = PropertyFactory.getProp(elem,data.w,0,null,this);
+ this.d = new DashProperty(elem,data.d||{},'svg',this);
this.initGradientData(elem, data, styleOb);
- this._isAnimated = !!this._isAnimated
- || this.w.effectsSequence.length
- || this.d._isAnimated;
+ this._isAnimated = !!this._isAnimated;
}
-SVGGradientStrokeStyleData.prototype.initGradientData = SVGGradientFillStyleData.prototype.initGradientData;
-SVGGradientStrokeStyleData.prototype.setGradientData = SVGGradientFillStyleData.prototype.setGradientData;
-SVGGradientStrokeStyleData.prototype.setGradientOpacity = SVGGradientFillStyleData.prototype.setGradientOpacity;
\ No newline at end of file
+extendPrototype([SVGGradientFillStyleData, DynamicPropertyContainer], SVGGradientStrokeStyleData);
\ No newline at end of file
diff --git a/player/js/elements/helpers/shapes/SVGStrokeStyleData.js b/player/js/elements/helpers/shapes/SVGStrokeStyleData.js
index f66e54c..3548095 100644
--- a/player/js/elements/helpers/shapes/SVGStrokeStyleData.js
+++ b/player/js/elements/helpers/shapes/SVGStrokeStyleData.js
@@ -1,12 +1,12 @@
function SVGStrokeStyleData(elem, data, styleOb){
- this.o = PropertyFactory.getProp(elem,data.o,0,0.01,elem);
- this.w = PropertyFactory.getProp(elem,data.w,0,null,elem);
- this.d = new DashProperty(elem,data.d||{},'svg',elem);
- this.c = PropertyFactory.getProp(elem,data.c,1,255,elem);
+ this.initDynamicPropertyContainer(elem);
+ this.getValue = this.iterateDynamicProperties;
+ this.o = PropertyFactory.getProp(elem,data.o,0,0.01,this);
+ this.w = PropertyFactory.getProp(elem,data.w,0,null,this);
+ this.d = new DashProperty(elem,data.d||{},'svg',this);
+ this.c = PropertyFactory.getProp(elem,data.c,1,255,this);
this.style = styleOb;
- this._isAnimated = !!this._isAnimated
- || this.o.effectsSequence.length
- || this.w.effectsSequence.length
- || this.c.effectsSequence.length
- || this.d._isAnimated;
-}
\ No newline at end of file
+ this._isAnimated = !!this._isAnimated;
+}
+
+extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData);
\ No newline at end of file
diff --git a/player/js/utils/PropertyFactory.js b/player/js/utils/PropertyFactory.js
index ef75d30..06141ff 100644
--- a/player/js/utils/PropertyFactory.js
+++ b/player/js/utils/PropertyFactory.js
@@ -1,6 +1,7 @@
var PropertyFactory = (function(){
var initFrame = initialDefaultFrame;
+ var math_abs = Math.abs;
function interpolateValue(frameNum, caching){
var offsetTime = this.offsetTime;
@@ -242,7 +243,7 @@
var multipliedValue;
if(this.propType === 'unidimensional') {
multipliedValue = val * this.mult;
- if(Math.abs(this.v - multipliedValue) > 0.00001) {
+ if(math_abs(this.v - multipliedValue) > 0.00001) {
this.v = multipliedValue;
this._mdf = true;
}
@@ -250,7 +251,7 @@
var i = 0, len = this.v.length;
while (i < len) {
multipliedValue = val[i] * this.mult;
- if (Math.abs(this.v[i] - multipliedValue) > 0.00001) {
+ if (math_abs(this.v[i] - multipliedValue) > 0.00001) {
this.v[i] = multipliedValue;
this._mdf = true;
}
diff --git a/player/js/utils/TransformProperty.js b/player/js/utils/TransformProperty.js
index 8c8489a..0a03750 100644
--- a/player/js/utils/TransformProperty.js
+++ b/player/js/utils/TransformProperty.js
@@ -82,29 +82,6 @@
this.frameId = this.elem.globalData.frameId;
}
- function setInverted(){
- this.inverted = true;
- this.iv = new Matrix();
- if(!this.k){
- if(this.data.p.s){
- this.iv.translate(this.px.v,this.py.v,-this.pz.v);
- }else{
- this.iv.translate(this.p.v[0],this.p.v[1],-this.p.v[2]);
- }
- if(this.r){
- this.iv.rotate(-this.r.v);
- }else{
- this.iv.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v);
- }
- if(this.s){
- this.iv.scale(this.s.v[0],this.s.v[1],1);
- }
- if(this.a){
- this.iv.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]);
- }
- }
- }
-
function precalculateMatrix() {
if(!this.a.k) {
this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
@@ -154,14 +131,12 @@
this.elem = elem;
this.frameId = -1;
this.propType = 'transform';
- this.container = container || elem;
- this.dynamicProperties = [];
- this._mdf = false;
this.data = data;
this.v = new Matrix();
//Precalculated matrix with non animated properties
this.pre = new Matrix();
this.appliedTransformations = 0;
+ this.initDynamicPropertyContainer(container || elem);
if(data.p.s){
this.px = PropertyFactory.getProp(elem,data.p.x,0,0,this);
this.py = PropertyFactory.getProp(elem,data.p.y,0,0,this);
@@ -213,7 +188,6 @@
applyToMatrix: applyToMatrix,
getValue: processKeys,
precalculateMatrix: precalculateMatrix,
- setInverted: setInverted,
autoOrient: autoOrient
}
diff --git a/player/js/utils/helpers/dynamicProperties.js b/player/js/utils/helpers/dynamicProperties.js
index ca7348e..1c41c52 100644
--- a/player/js/utils/helpers/dynamicProperties.js
+++ b/player/js/utils/helpers/dynamicProperties.js
@@ -4,6 +4,7 @@
if(this.dynamicProperties.indexOf(prop) === -1) {
this.dynamicProperties.push(prop);
this.container.addDynamicProperty(this);
+ this._isAnimated = true;
}
},
iterateDynamicProperties: function(){
@@ -15,5 +16,11 @@
this._mdf = true;
}
}
+ },
+ initDynamicPropertyContainer: function(container){
+ this.container = container;
+ this.dynamicProperties = [];
+ this._mdf = false;
+ this._isAnimated = false;
}
}
\ No newline at end of file
diff --git a/player/js/utils/shapes/DashProperty.js b/player/js/utils/shapes/DashProperty.js
index e9f07c7..abe9983 100644
--- a/player/js/utils/shapes/DashProperty.js
+++ b/player/js/utils/shapes/DashProperty.js
@@ -1,15 +1,13 @@
function DashProperty(elem, data, renderer) {
this.elem = elem;
- this.container = elem;
this.frameId = -1;
this.dataProps = createSizedArray(data.length);
this.renderer = renderer;
- this._mdf = false;
this.k = false;
- this.dynamicProperties = [];
this.dashStr = '';
this.dashArray = createTypedArray('float32', data.length ? data.length - 1 : 0);
this.dashoffset = createTypedArray('float32', 1);
+ this.initDynamicPropertyContainer(elem);
var i, len = data.length || 0, prop;
for(i = 0; i < len; i += 1) {
prop = PropertyFactory.getProp(elem,data[i].v,0, 0, this);
diff --git a/player/js/utils/shapes/GradientProperty.js b/player/js/utils/shapes/GradientProperty.js
index dab45ab..7cff184 100644
--- a/player/js/utils/shapes/GradientProperty.js
+++ b/player/js/utils/shapes/GradientProperty.js
@@ -1,8 +1,5 @@
function GradientProperty(elem,data){
- this.container = elem;
- this.prop = PropertyFactory.getProp(elem,data.k,1,null,this);
this.data = data;
- this.k = this.prop.k;
this.c = createTypedArray('uint8c', data.p*4);
var cLength = data.k.k[0].s ? (data.k.k[0].s.length - data.p*4) : data.k.k.length - data.p*4;
this.o = createTypedArray('float32', cLength);
@@ -10,14 +7,12 @@
this._omdf = false;
this._collapsable = this.checkCollapsable();
this._hasOpacity = cLength;
- this._mdf = false;
+ this.initDynamicPropertyContainer(elem);
+ this.prop = PropertyFactory.getProp(elem,data.k,1,null,this);
+ this.k = this.prop.k;
this.getValue(true);
}
-GradientProperty.prototype.addDynamicProperty = function(prop) {
- this.container.addDynamicProperty(this);
-}
-
GradientProperty.prototype.comparePoints = function(values, points) {
var i = 0, len = this.o.length/2, diff;
while(i < len) {
@@ -77,4 +72,6 @@
}
this._mdf = !forceRender;
}
-};
\ No newline at end of file
+};
+
+extendPrototype([DynamicPropertyContainer], GradientProperty);
\ No newline at end of file
diff --git a/player/js/utils/shapes/RepeaterModifier.js b/player/js/utils/shapes/RepeaterModifier.js
index abc84c3..0b54adc 100644
--- a/player/js/utils/shapes/RepeaterModifier.js
+++ b/player/js/utils/shapes/RepeaterModifier.js
@@ -33,15 +33,14 @@
RepeaterModifier.prototype.init = function(elem, arr, pos, elemsData) {
this.elem = elem;
- this.container = elem;
this.arr = arr;
this.pos = pos;
this.elemsData = elemsData;
this._currentCopies = 0;
this._elements = [];
this._groups = [];
- this.dynamicProperties = [];
this.frameId = -1;
+ this.initDynamicPropertyContainer(elem);
this.initModifierProperties(elem,arr[pos]);
var cont = 0;
while(pos>0){
diff --git a/player/js/utils/shapes/ShapeModifiers.js b/player/js/utils/shapes/ShapeModifiers.js
index b9776af..32f9f98 100644
--- a/player/js/utils/shapes/ShapeModifiers.js
+++ b/player/js/utils/shapes/ShapeModifiers.js
@@ -31,13 +31,11 @@
}
};
ShapeModifier.prototype.init = function(elem,data){
- this.dynamicProperties = [];
this.shapes = [];
this.elem = elem;
- this.container = elem;
+ this.initDynamicPropertyContainer(elem);
this.initModifierProperties(elem,data);
this.frameId = initialDefaultFrame;
- this._mdf = false;
this.closed = false;
this.k = false;
if(this.dynamicProperties.length){
diff --git a/player/js/utils/shapes/ShapeProperty.js b/player/js/utils/shapes/ShapeProperty.js
index b00f605..729fbcd 100644
--- a/player/js/utils/shapes/ShapeProperty.js
+++ b/player/js/utils/shapes/ShapeProperty.js
@@ -197,12 +197,10 @@
this.paths = this.localShapeCollection;
this.localShapeCollection.addShape(this.v);
this.d = data.d;
- this.dynamicProperties = [];
this.elem = elem;
- this.container = elem;
this.comp = elem.comp;
this.frameId = -1;
- this._mdf = false;
+ this.initDynamicPropertyContainer(elem);
this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
if(this.dynamicProperties.length){
@@ -268,13 +266,11 @@
this.v = shape_pool.newElement();
this.v.setPathData(true, 0);
this.elem = elem;
- this.container = elem;
this.comp = elem.comp;
this.data = data;
this.frameId = -1;
this.d = data.d;
- this.dynamicProperties = [];
- this._mdf = false;
+ this.initDynamicPropertyContainer(elem);
if(data.sy === 1){
this.ir = PropertyFactory.getProp(elem,data.ir,0,0,this);
this.is = PropertyFactory.getProp(elem,data.is,0,0.01,this);
@@ -386,12 +382,10 @@
this.localShapeCollection.addShape(this.v);
this.paths = this.localShapeCollection;
this.elem = elem;
- this.container = elem;
this.comp = elem.comp;
this.frameId = -1;
this.d = data.d;
- this.dynamicProperties = [];
- this._mdf = false;
+ this.initDynamicPropertyContainer(elem);
this.p = PropertyFactory.getProp(elem,data.p,1,0,this);
this.s = PropertyFactory.getProp(elem,data.s,1,0,this);
this.r = PropertyFactory.getProp(elem,data.r,0,0,this);
diff --git a/player/js/utils/shapes/TrimModifier.js b/player/js/utils/shapes/TrimModifier.js
index 1e23cee..267b3cd 100644
--- a/player/js/utils/shapes/TrimModifier.js
+++ b/player/js/utils/shapes/TrimModifier.js
@@ -91,6 +91,8 @@
s = e;
e = _s;
}
+ s = Math.round(s*1000)/1000;
+ e = Math.round(e*1000)/1000;
this.sValue = s;
this.eValue = e;
} else {
diff --git a/player/js/utils/text/TextAnimatorProperty.js b/player/js/utils/text/TextAnimatorProperty.js
index 49648cb..4a77e7e 100644
--- a/player/js/utils/text/TextAnimatorProperty.js
+++ b/player/js/utils/text/TextAnimatorProperty.js
@@ -1,13 +1,10 @@
function TextAnimatorProperty(textData, renderType, elem){
- this._mdf = false;
this._isFirstFrame = true;
this._hasMaskedPath = false;
this._frameId = -1;
- this.dynamicProperties = [];
this._textData = textData;
this._renderType = renderType;
this._elem = elem;
- this.container = elem;
this._animatorsData = createSizedArray(this._textData.a.length);
this._pathData = {};
this._moreOptions = {
@@ -15,6 +12,7 @@
};
this.renderedLetters = [];
this.lettersChangedFlag = false;
+ this.initDynamicPropertyContainer(elem);
}
diff --git a/player/js/utils/text/TextSelectorProperty.js b/player/js/utils/text/TextSelectorProperty.js
index e0d02b5..70f0cfc 100644
--- a/player/js/utils/text/TextSelectorProperty.js
+++ b/player/js/utils/text/TextSelectorProperty.js
@@ -4,16 +4,14 @@
var floor = Math.floor;
function TextSelectorProp(elem,data){
- this._mdf = false;
this._currentTextLength = -1;
this.k = false;
this.data = data;
- this.dynamicProperties = [];
this.elem = elem;
- this.container = elem;
this.comp = elem.comp;
this.finalS = 0;
this.finalE = 0;
+ this.initDynamicPropertyContainer(elem);
this.s = PropertyFactory.getProp(elem,data.s || {k:0},0,0,this);
if('e' in data){
this.e = PropertyFactory.getProp(elem,data.e,0,0,this);