blob: b20a58e40e669c61f6d3c23834e6515f6da2810d [file] [log] [blame]
function HBaseElement(data, globalData, comp) {}
HBaseElement.prototype = {
checkBlendMode: function () {},
initRendererElement: function () {
this.baseElement = createTag(this.data.tg || 'div');
if(this.data.hasMask) {
this.svgElement = createNS('svg');
this.layerElement = createNS('g');
this.maskedElement = this.layerElement;
this.svgElement.appendChild(this.layerElement);
this.baseElement.appendChild(this.svgElement);
} else {
this.layerElement = this.baseElement;
}
styleDiv(this.baseElement);
},
createContainerElements: function () {
this.renderableEffectsManager = new CVEffects(this);
this.transformedElement = this.baseElement;
this.maskedElement = this.layerElement;
if (this.data.ln) {
this.layerElement.setAttribute('id', this.data.ln);
}
if (this.data.cl) {
this.layerElement.setAttribute('class', this.data.cl);
}
if (this.data.bm !== 0) {
this.setBlendMode();
}
},
renderElement: function () {
if(this.finalTransform._matMdf) {
this.transformedElement.style.transform = this.transformedElement.style.webkitTransform = this.finalTransform.mat.toCSS();
}
if(this.finalTransform._opMdf) {
this.transformedElement.style.opacity = this.finalTransform.mProp.o.v;
}
},
renderFrame: function () {
// If it is exported as hidden (data.hd === true) no need to render
// If it is not visible no need to render
if (this.data.hd || this.hidden) {
return;
}
this.renderTransform();
this.renderRenderable();
this.renderElement();
this.renderInnerContent();
if (this._isFirstFrame) {
this._isFirstFrame = false;
}
},
destroy: function () {
this.layerElement = null;
this.transformedElement = null;
if(this.matteElement) {
this.matteElement = null;
}
if(this.maskManager) {
this.maskManager.destroy();
this.maskManager = null;
}
},
createRenderableComponents: function () {
this.maskManager = new MaskElement(this.data, this, this.globalData);
},
addEffects: function () {
},
setMatte: function () {}
};
HBaseElement.prototype.getBaseElement = SVGBaseElement.prototype.getBaseElement;
HBaseElement.prototype.destroyBaseElement = HBaseElement.prototype.destroy;
HBaseElement.prototype.buildElementParenting = HybridRenderer.prototype.buildElementParenting;