ShapePathInterface.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import propertyGroupFactory from '../PropertyGroupFactory';
  2. import PropertyInterface from '../PropertyInterface';
  3. const ShapePathInterface = (
  4. function () {
  5. return function pathInterfaceFactory(shape, view, propertyGroup) {
  6. var prop = view.sh;
  7. function interfaceFunction(val) {
  8. if (val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 'ADBE Vector Shape' || val === 2) {
  9. return interfaceFunction.path;
  10. }
  11. return null;
  12. }
  13. var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
  14. prop.setGroupProperty(PropertyInterface('Path', _propertyGroup));
  15. Object.defineProperties(interfaceFunction, {
  16. path: {
  17. get: function () {
  18. if (prop.k) {
  19. prop.getValue();
  20. }
  21. return prop;
  22. },
  23. },
  24. shape: {
  25. get: function () {
  26. if (prop.k) {
  27. prop.getValue();
  28. }
  29. return prop;
  30. },
  31. },
  32. _name: { value: shape.nm },
  33. ix: { value: shape.ix },
  34. propertyIndex: { value: shape.ix },
  35. mn: { value: shape.mn },
  36. propertyGroup: { value: propertyGroup },
  37. });
  38. return interfaceFunction;
  39. };
  40. }()
  41. );
  42. export default ShapePathInterface;