blob: 69b51db39b938b8d4e3cf4b169a2899062767880 [file] [log] [blame]
function BaseElement() {
}
BaseElement.prototype = {
checkMasks: function () {
if (!this.data.hasMask) {
return false;
}
var i = 0, len = this.data.masksProperties.length;
while (i < len) {
if ((this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false)) {
return true;
}
i += 1;
}
return false;
},
initExpressions: function () {
this.layerInterface = LayerExpressionInterface(this);
if (this.data.hasMask && this.maskManager) {
this.layerInterface.registerMaskInterface(this.maskManager);
}
var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this, this.layerInterface);
this.layerInterface.registerEffectsInterface(effectsInterface);
if (this.data.ty === 0 || this.data.xt) {
this.compInterface = CompExpressionInterface(this);
} else if (this.data.ty === 4) {
this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData, this.itemsData, this.layerInterface);
this.layerInterface.content = this.layerInterface.shapeInterface;
} else if (this.data.ty === 5) {
this.layerInterface.textInterface = TextExpressionInterface(this);
this.layerInterface.text = this.layerInterface.textInterface;
}
},
setBlendMode: function () {
var blendModeValue = getBlendMode(this.data.bm);
var elem = this.baseElement || this.layerElement;
elem.style['mix-blend-mode'] = blendModeValue;
},
initBaseData: function (data, globalData, comp) {
this.globalData = globalData;
this.comp = comp;
this.data = data;
this.layerId = createElementID();
// Stretch factor for old animations missing this property.
if (!this.data.sr) {
this.data.sr = 1;
}
// effects manager
this.effectsManager = new EffectsManager(this.data, this, this.dynamicProperties);
},
getType: function () {
return this.type;
}
, sourceRectAtTime: function () {},
};