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.

circle.ts 612B

1234567891011121314151617181920212223242526272829
  1. import CodeShape from "./index"
  2. import { v4 as uuid } from "uuid"
  3. import { CircleShape, ShapeType } from "types"
  4. export default class Circle extends CodeShape<CircleShape> {
  5. constructor(props = {} as Partial<CircleShape>) {
  6. super({
  7. id: uuid(),
  8. type: ShapeType.Circle,
  9. isGenerated: true,
  10. name: "Circle",
  11. parentId: "page0",
  12. childIndex: 0,
  13. point: [0, 0],
  14. rotation: 0,
  15. radius: 20,
  16. style: {
  17. fill: "#777",
  18. stroke: "#000",
  19. strokeWidth: 1,
  20. },
  21. ...props,
  22. })
  23. }
  24. get radius() {
  25. return this.shape.radius
  26. }
  27. }