first commit
This commit is contained in:
52
node_modules/lottie-web/player/js/elements/helpers/HierarchyElement.js
generated
vendored
Normal file
52
node_modules/lottie-web/player/js/elements/helpers/HierarchyElement.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* @file
|
||||
* Handles AE's layer parenting property.
|
||||
*
|
||||
*/
|
||||
|
||||
function HierarchyElement() {}
|
||||
|
||||
HierarchyElement.prototype = {
|
||||
/**
|
||||
* @function
|
||||
* Initializes hierarchy properties
|
||||
*
|
||||
*/
|
||||
initHierarchy: function () {
|
||||
// element's parent list
|
||||
this.hierarchy = [];
|
||||
// if element is parent of another layer _isParent will be true
|
||||
this._isParent = false;
|
||||
this.checkParenting();
|
||||
},
|
||||
/**
|
||||
* @function
|
||||
* Sets layer's hierarchy.
|
||||
* @param {array} hierarch
|
||||
* layer's parent list
|
||||
*
|
||||
*/
|
||||
setHierarchy: function (hierarchy) {
|
||||
this.hierarchy = hierarchy;
|
||||
},
|
||||
/**
|
||||
* @function
|
||||
* Sets layer as parent.
|
||||
*
|
||||
*/
|
||||
setAsParent: function () {
|
||||
this._isParent = true;
|
||||
},
|
||||
/**
|
||||
* @function
|
||||
* Searches layer's parenting chain
|
||||
*
|
||||
*/
|
||||
checkParenting: function () {
|
||||
if (this.data.parent !== undefined) {
|
||||
this.comp.buildElementParenting(this, this.data.parent, []);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default HierarchyElement;
|
Reference in New Issue
Block a user