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 758B

12345678910111213141516171819202122232425262728293031
  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. /* ----------------- Start Copy Here ---------------- */
  6. export default class Draw extends CodeShape<DrawShape> {
  7. constructor(props = {} as ShapeProps<DrawShape>) {
  8. super({
  9. id: uniqueId(),
  10. type: ShapeType.Draw,
  11. isGenerated: false,
  12. parentId: (window as any).currentPageId,
  13. name: 'Draw',
  14. childIndex: 0,
  15. point: [0, 0],
  16. points: [],
  17. rotation: 0,
  18. isAspectRatioLocked: false,
  19. isLocked: false,
  20. isHidden: false,
  21. ...props,
  22. style: {
  23. ...defaultStyle,
  24. ...props.style,
  25. },
  26. })
  27. }
  28. }