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