Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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: false,
  12. name: "Dot",
  13. parentId: "page0",
  14. childIndex: 0,
  15. point: [0, 0],
  16. rotation: 0,
  17. style: {
  18. fill: "#777",
  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. }