first commit
This commit is contained in:
54
node_modules/lottie-web/player/js/elements/helpers/FrameElement.js
generated
vendored
Normal file
54
node_modules/lottie-web/player/js/elements/helpers/FrameElement.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* @file
|
||||
* Handles element's layer frame update.
|
||||
* Checks layer in point and out point
|
||||
*
|
||||
*/
|
||||
|
||||
function FrameElement() {}
|
||||
|
||||
FrameElement.prototype = {
|
||||
/**
|
||||
* @function
|
||||
* Initializes frame related properties.
|
||||
*
|
||||
*/
|
||||
initFrame: function () {
|
||||
// set to true when inpoint is rendered
|
||||
this._isFirstFrame = false;
|
||||
// list of animated properties
|
||||
this.dynamicProperties = [];
|
||||
// If layer has been modified in current tick this will be true
|
||||
this._mdf = false;
|
||||
},
|
||||
/**
|
||||
* @function
|
||||
* Calculates all dynamic values
|
||||
*
|
||||
* @param {number} num
|
||||
* current frame number in Layer's time
|
||||
* @param {boolean} isVisible
|
||||
* if layers is currently in range
|
||||
*
|
||||
*/
|
||||
prepareProperties: function (num, isVisible) {
|
||||
var i;
|
||||
var len = this.dynamicProperties.length;
|
||||
for (i = 0; i < len; i += 1) {
|
||||
if (isVisible || (this._isParent && this.dynamicProperties[i].propType === 'transform')) {
|
||||
this.dynamicProperties[i].getValue();
|
||||
if (this.dynamicProperties[i]._mdf) {
|
||||
this.globalData._mdf = true;
|
||||
this._mdf = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
addDynamicProperty: function (prop) {
|
||||
if (this.dynamicProperties.indexOf(prop) === -1) {
|
||||
this.dynamicProperties.push(prop);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default FrameElement;
|
Reference in New Issue
Block a user