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.

draw.ts 723B

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