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.

dot.ts 736B

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