SVGShapeData.js 857 B

12345678910111213141516171819202122232425262728
  1. function SVGShapeData(transformers, level, shape) {
  2. this.caches = [];
  3. this.styles = [];
  4. this.transformers = transformers;
  5. this.lStr = '';
  6. this.sh = shape;
  7. this.lvl = level;
  8. // TODO find if there are some cases where _isAnimated can be false.
  9. // For now, since shapes add up with other shapes. They have to be calculated every time.
  10. // One way of finding out is checking if all styles associated to this shape depend only of this shape
  11. this._isAnimated = !!shape.k;
  12. // TODO: commenting this for now since all shapes are animated
  13. var i = 0;
  14. var len = transformers.length;
  15. while (i < len) {
  16. if (transformers[i].mProps.dynamicProperties.length) {
  17. this._isAnimated = true;
  18. break;
  19. }
  20. i += 1;
  21. }
  22. }
  23. SVGShapeData.prototype.setAsAnimated = function () {
  24. this._isAnimated = true;
  25. };
  26. export default SVGShapeData;