SVGCompElement.js 1008 B

12345678910111213141516171819202122232425262728
  1. import {
  2. extendPrototype,
  3. } from '../../utils/functionExtensions';
  4. import {
  5. createSizedArray,
  6. } from '../../utils/helpers/arrays';
  7. import PropertyFactory from '../../utils/PropertyFactory';
  8. import SVGRendererBase from '../../renderers/SVGRendererBase'; // eslint-disable-line
  9. import SVGBaseElement from './SVGBaseElement';
  10. import ICompElement from '../CompElement';
  11. function SVGCompElement(data, globalData, comp) {
  12. this.layers = data.layers;
  13. this.supports3d = true;
  14. this.completeLayers = false;
  15. this.pendingElements = [];
  16. this.elements = this.layers ? createSizedArray(this.layers.length) : [];
  17. this.initElement(data, globalData, comp);
  18. this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : { _placeholder: true };
  19. }
  20. extendPrototype([SVGRendererBase, ICompElement, SVGBaseElement], SVGCompElement);
  21. SVGCompElement.prototype.createComp = function (data) {
  22. return new SVGCompElement(data, this.globalData, this);
  23. };
  24. export default SVGCompElement;