You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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