blob: 3177de774922b012103684adb52d71b71f73fcc2 [file] [log] [blame]
function ICompElement(data,parentContainer,globalData,comp, placeholder){
this._parent.constructor.call(this,data,parentContainer,globalData,comp, placeholder);
this.layers = data.layers;
this.isSvg = true;
if(this.data.tm){
this.tm = PropertyFactory.getProp(this,this.data.tm,0,globalData.frameRate,this.dynamicProperties);
}
}
createElement(SVGBaseElement, ICompElement);
extendPrototype(ExpressionComp,ICompElement);
ICompElement.prototype.getComposingElement = function(){
return this.layerElement;
};
ICompElement.prototype.hide = function(){
if(!this.hidden){
var i,len = this.elements.length;
for( i = 0; i < len; i+=1 ){
this.elements[i].hide();
}
this.hidden = true;
}
};
ICompElement.prototype.prepareFrame = function(num){
this._parent.prepareFrame.call(this,num);
if(this.isVisible===false){
return;
}
var timeRemapped = num;
if(this.tm){
timeRemapped = this.tm.v;
if(timeRemapped === this.data.op){
timeRemapped = this.data.op - 1;
}
}
this.renderedFrame = timeRemapped;
var i,len = this.elements.length;
for( i = 0; i < len; i+=1 ){
this.elements[i].prepareFrame(timeRemapped - this.layers[i].st);
}
};
ICompElement.prototype.renderFrame = function(parentMatrix){
var renderParent = this._parent.renderFrame.call(this,parentMatrix);
var i,len = this.layers.length;
if(renderParent===false){
this.hide();
return;
}
this.hidden = false;
for( i = 0; i < len; i+=1 ){
if(this.data.hasMask){
this.elements[i].renderFrame();
}else{
this.elements[i].renderFrame(this.finalTransform);
}
}
if(this.firstFrame){
this.firstFrame = false;
}
};
ICompElement.prototype.setElements = function(elems){
this.elements = elems;
};
ICompElement.prototype.getElements = function(){
return this.elements;
};
ICompElement.prototype.destroy = function(){
this._parent.destroy.call();
var i,len = this.layers.length;
for( i = 0; i < len; i+=1 ){
this.elements[i].destroy();
}
};