Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

rectangle.ts 632B

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