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.

ellipse.ts 893B

123456789101112131415161718192021222324252627282930313233343536
  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. parentId: (window as any).currentPageId,
  11. type: ShapeType.Ellipse,
  12. isGenerated: true,
  13. name: 'Ellipse',
  14. childIndex: 0,
  15. point: [0, 0],
  16. radiusX: 50,
  17. radiusY: 50,
  18. rotation: 0,
  19. isAspectRatioLocked: false,
  20. isLocked: false,
  21. isHidden: false,
  22. ...props,
  23. style: { ...defaultStyle, ...props.style },
  24. })
  25. }
  26. get radiusX(): number {
  27. return this.shape.radiusX
  28. }
  29. get radiusY(): number {
  30. return this.shape.radiusY
  31. }
  32. }