123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- /**
- * @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;
|