temp-path.vue 690 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <v-path :config="config" name="icon-path" />
  3. <v-path :config="props.config" name="icon-path" />
  4. </template>
  5. <script lang="ts" setup>
  6. import { parseSvgContent } from "@/utils/resource";
  7. import { Transform } from "konva/lib/Util";
  8. import { computed } from "vue";
  9. const props = defineProps<{
  10. config: ReturnType<typeof parseSvgContent>["paths"][0];
  11. mat: Transform;
  12. }>();
  13. const config = computed(() => {
  14. if (!props.config.fix) {
  15. return props.config;
  16. }
  17. // return props.config;
  18. const inv = props.mat.copy().invert();
  19. const invDec = inv.decompose();
  20. const config = {
  21. ...props.config,
  22. ...invDec,
  23. x: 0,
  24. y: 0,
  25. };
  26. return config;
  27. });
  28. </script>