1234567891011121314151617181920212223242526272829303132 |
- <template>
- <v-path :config="config" name="icon-path" />
- <v-path :config="props.config" name="icon-path" />
- </template>
- <script lang="ts" setup>
- import { parseSvgContent } from "@/utils/resource";
- import { Transform } from "konva/lib/Util";
- import { computed } from "vue";
- const props = defineProps<{
- config: ReturnType<typeof parseSvgContent>["paths"][0];
- mat: Transform;
- }>();
- const config = computed(() => {
- if (!props.config.fix) {
- return props.config;
- }
- // return props.config;
- const inv = props.mat.copy().invert();
- const invDec = inv.decompose();
- const config = {
- ...props.config,
- ...invDec,
- x: 0,
- y: 0,
- };
- return config;
- });
- </script>
|