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

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