bill 8 months ago
parent
commit
19be2364eb
1 changed files with 8 additions and 12 deletions
  1. 8 12
      src/components/tagging/sign-new.vue

+ 8 - 12
src/components/tagging/sign-new.vue

@@ -66,7 +66,6 @@ const emit = defineEmits<{
   ): void;
 }>();
 
-// const pos = ref();
 const [posStyle, pos, pause, recovery] = usePixel(() => undefined);
 
 const queryItems = computed(() =>
@@ -84,16 +83,21 @@ const tag = sdk.createTagging({
   image: getFileUrl(taggingStyle.value!.icon),
 });
 
+const changePos = () => {
+  console.error("getImageCenter", tag.getImageCenter());
+  pos.value = { localPos: tag.getImageCenter(), modelId: props.scenePos.modelId };
+};
+
 watch(taggingStyle, (icon) => icon && tag.changeImage(getFileUrl(icon.icon)));
 watchEffect(() => {
   tag.changeCanMove(router.currentRoute.value.name === RoutesName.tagging);
 });
-watchEffect(() => tag.changeMat(props.scenePos.mat));
+// watchEffect(() => tag.changeMat(props.scenePos.mat));
+// watchEffect(() => tag.changeFontSize(props.scenePos.fontSize));
+// watchEffect(() => tag.changeLineHeight(props.scenePos.lineHeight));
 watchEffect(() => tag.changeAltitudeAboveGround(props.scenePos.altitudeAboveGround));
 watchEffect(() => tag.changeTitle(props.tagging.title));
 watchEffect(() => tag.visibilityTitle(props.tagging.show3dTitle));
-watchEffect(() => tag.changeFontSize(props.scenePos.fontSize));
-watchEffect(() => tag.changeLineHeight(props.scenePos.lineHeight));
 watchEffect(() => {
   tag.changeType(props.scenePos.type);
   changePos();
@@ -134,12 +138,6 @@ watchEffect(() => {
     }, 100);
   }
 });
-
-const changePos = () => {
-  pos.value = { localPos: tag.getImageCenter(), modelId: props.scenePos.modelId };
-};
-changePos();
-
 const pullIndex = ref(-1);
 const showContent = computed(() => {
   return (
@@ -162,9 +160,7 @@ const iconClickHandler = () => {
   }
 };
 
-console.log("create");
 onUnmounted(() => {
-  console.log("destory");
   tag.destory();
 });
 </script>