bill 8 månader sedan
förälder
incheckning
92519e5b80
4 ändrade filer med 9 tillägg och 11 borttagningar
  1. 0 1
      src/api/path.ts
  2. 1 2
      src/components/path/sign.vue
  3. 2 5
      src/sdk/sdk.ts
  4. 6 3
      src/views/guide/path/edit-path.vue

+ 0 - 1
src/api/path.ts

@@ -15,7 +15,6 @@ export interface Path {
   linePosition?: {
     position: SceneLocalPos;
     modelId: string;
-    normal: SceneLocalPos;
   };
   lineWidth: number;
   lineColor: string;

+ 1 - 2
src/components/path/sign.vue

@@ -32,7 +32,6 @@ const getLineProps = () => ({
   color: props.path.lineColor,
   altitudeAboveGround: props.path.lineAltitudeAboveGround,
   position: props.path.linePosition?.position || props.path.points[0]?.position,
-  normal: props.path.linePosition?.normal || { x: 0, y: 0, z: 1 },
   modelId: props.path.linePosition?.modelId || props.path.points[0]?.modelId,
 });
 
@@ -48,6 +47,7 @@ const path = sdk.createPath({
 path.changeCanEdit(false);
 
 watchEffect(() => path.visibilityName(props.path.showName));
+watchEffect(() => path.changeFontSize(props.path.fontSize));
 
 watchEffect(() => {
   const range = props.path.globalVisibility ? -1 : props.path.visibilityRange;
@@ -111,7 +111,6 @@ watch(
 path.bus.on("linePositionChange", (position) => {
   const p = {
     position: { ...position.pos },
-    normal: { ...position.normal },
     modelId: position.modelId,
   };
   currentLine = { ...getLineProps(), ...p };

+ 2 - 5
src/sdk/sdk.ts

@@ -216,7 +216,6 @@ export type PathProps = {
     color: string,
     altitudeAboveGround: number
     position: SceneLocalPos,
-    normal: SceneLocalPos,
     modelId: string
   },
   points: {
@@ -238,12 +237,12 @@ export type Path = {
     // 线段坐标更改事件
     linePositionChange: {
       pos: SceneLocalPos,
-      normal: SceneLocalPos,
       modelId: string
     }
     // 路径点位置变更
     changePoints: PathProps['points']
   }>;
+  changeFontSize: (fontSize: number) => void
   changeVisibilityRange: (range: number) => void
   changePointName: (index: number, name: string) => void
   // 飞向路径
@@ -307,9 +306,7 @@ export type Tagging3D = {
     // 贴地射线获取的位置
     position: SceneLocalPos
     normal: SceneLocalPos
-  }) => {
-
-  }
+  }) => void
   changeFontSize: (fontSize: number) => void
   changeLineHeight: (lineHeight: number) => void
   // 设置标题

+ 6 - 3
src/views/guide/path/edit-path.vue

@@ -27,19 +27,22 @@
                 v-model:value="data.lineWidth"
                 :max="1"
                 :min="0.2"
+                :step="0.1"
                 :controls="false"
               >
                 <template #addonBefore>
                   <span
                     class="fun-ctrl"
-                    @click="data.lineWidth = Math.max(1, data.lineWidth - 1)"
+                    @click="
+                      data.lineWidth = round(Math.max(0.2, data.lineWidth - 0.1), 1)
+                    "
                     >-</span
                   >
                 </template>
                 <template #addonAfter>
                   <span
                     class="fun-ctrl"
-                    @click="data.lineWidth = Math.min(100, data.lineWidth + 1)"
+                    @click="data.lineWidth = round(Math.min(1, data.lineWidth + 0.1), 1)"
                     >+</span
                   >
                 </template>
@@ -160,7 +163,7 @@ import { computed, onUnmounted, ref, shallowRef, watch, watchEffect } from "vue"
 import { isTemploraryID, Path } from "@/store";
 import { RightFillPano } from "@/layout";
 import { useViewStack } from "@/hook";
-import { togetherCallback } from "@/utils";
+import { round, togetherCallback } from "@/utils";
 import { Switch, Slider, Button, InputNumber } from "ant-design-vue";
 import SignItem from "@/views/tagging-position/sign-item.vue";
 import { Message } from "bill/expose-common";