Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

polyline.ts 876B

1234567891011121314151617181920212223242526272829303132333435
  1. import CodeShape from './index'
  2. import { uniqueId } from 'utils'
  3. import { PolylineShape, ShapeProps, ShapeType } from 'types'
  4. import { defaultStyle } from 'state/shape-styles'
  5. /* ----------------- Start Copy Here ---------------- */
  6. export default class Polyline extends CodeShape<PolylineShape> {
  7. constructor(props = {} as ShapeProps<PolylineShape>) {
  8. super({
  9. id: uniqueId(),
  10. seed: Math.random(),
  11. parentId: (window as any).currentPageId,
  12. type: ShapeType.Polyline,
  13. isGenerated: true,
  14. name: 'Polyline',
  15. childIndex: 0,
  16. point: [0, 0],
  17. points: [[0, 0]],
  18. rotation: 0,
  19. isAspectRatioLocked: false,
  20. isLocked: false,
  21. isHidden: false,
  22. ...props,
  23. style: {
  24. ...defaultStyle,
  25. ...props.style,
  26. },
  27. })
  28. }
  29. get points(): number[][] {
  30. return this.shape.points
  31. }
  32. }