SolidElement.js 720 B

1234567891011121314151617181920212223
  1. import {
  2. extendPrototype,
  3. } from '../utils/functionExtensions';
  4. import createNS from '../utils/helpers/svg_elements';
  5. import IImageElement from './ImageElement';
  6. function ISolidElement(data, globalData, comp) {
  7. this.initElement(data, globalData, comp);
  8. }
  9. extendPrototype([IImageElement], ISolidElement);
  10. ISolidElement.prototype.createContent = function () {
  11. var rect = createNS('rect');
  12. /// /rect.style.width = this.data.sw;
  13. /// /rect.style.height = this.data.sh;
  14. /// /rect.style.fill = this.data.sc;
  15. rect.setAttribute('width', this.data.sw);
  16. rect.setAttribute('height', this.data.sh);
  17. rect.setAttribute('fill', this.data.sc);
  18. this.layerElement.appendChild(rect);
  19. };
  20. export default ISolidElement;