caoziwu há 1 semana atrás
pai
commit
512fcf3d94

+ 1 - 1
src/renderer/src/lib/speaker/jsxgraph/diagram.ts

@@ -363,7 +363,7 @@ export function drawDiagram(
       )
 
       // 覆盖角标签放在右上角
-      addObj('text', [maxD * 0.95, maxZ * 0.95, labels.coverageAngle], {
+      addObj('text', [maxD, maxZ, labels.coverageAngle], {
         fontSize: 11,
         color: '#ca8a04',
         anchorX: 'right',

+ 8 - 2
src/renderer/src/lib/speaker/jsxgraph/splDiagram.ts

@@ -103,8 +103,14 @@ export function drawSplDiagram(
     }
 
     const addObj = (type: string, args: any[], attrs: any = {}) => {
-      if (type === 'point') attrs.withLabel = false
+      if (type === 'point') {
+        attrs.withLabel = false
+      }
+      // 核心修复:强制所有图元锁死,禁止拖拽和悬停交互
+      attrs.fixed = true
       attrs.highlight = false
+      attrs.showInfobox = false
+
       const obj = board.create(type as any, args, attrs)
       currentObjects.push(obj)
       return obj
@@ -190,7 +196,7 @@ export function drawSplDiagram(
       })
     }
 
-    addObj('text', [xMax, yMin - (yMax - yMin) * 0.12, labels.distance], {
+    addObj('text', [xMax, yMin - (yMax - yMin) * 0.05, labels.distance], {
       fontSize: 10,
       color: pal.dim,
       anchorX: 'right',

+ 32 - 46
src/renderer/src/lib/speaker/jsxgraph/topDiagram.ts

@@ -119,14 +119,14 @@ export function drawTopDiagram(
       })
     }
     // 轴标题
-    addObj('text', [maxD * 0.95, -maxD * 0.08, '前方 (m)'], {
+    addObj('text', [maxD * 1.1, -maxD * 0.05, labels.forwardDistance], {
       fontSize: 10,
       color: pal.dim,
       anchorX: 'right',
       anchorY: 'top',
       layer: 1
     })
-    addObj('text', [-maxD * 0.05, maxD * 0.95, '左侧 (m)'], {
+    addObj('text', [-maxD * 0.05, maxD * 0.9, labels.lateralDistance], {
       fontSize: 10,
       color: pal.dim,
       anchorX: 'right',
@@ -207,17 +207,13 @@ export function drawTopDiagram(
 
     // 覆盖角标签(右上角)
     if (!isFullCircle) {
-      addObj(
-        'text',
-        [maxD * 0.95, maxD * 0.95, labels.coverageAngle],
-        {
-          fontSize: 11,
-          color: '#ca8a04',
-          anchorX: 'right',
-          anchorY: 'top',
-          layer: 4
-        }
-      )
+      addObj('text', [maxD, maxD * 0.95, labels.coverageAngle], {
+        fontSize: 11,
+        color: '#ca8a04',
+        anchorX: 'right',
+        anchorY: 'top',
+        layer: 4
+      })
     }
 
     // 6. D1/D2/D3 距离参考圆弧
@@ -263,47 +259,37 @@ export function drawTopDiagram(
         strokeWidth: 1.5,
         layer: 4
       })
+      const textY = maxD * 0.06
 
-      // 判断是否和前一个点靠得太近,如果近就强制往上错开一层
-      let currentTier = 0
-      if (index > 0) {
-        const prevX = sortedPts[index - 1].d
-        if (Math.abs(x - prevX) < maxD * 0.15) {
-          currentTier = 1
-        }
-      }
-
-      // 核心修改:textY 改为向上偏移(正数),层级错位也往上推
-      const textY = maxD * 0.06 + currentTier * (maxD * 0.12)
-
-      // 如果进行了层级错位,画一条辅助引线指上去
-      if (currentTier > 0) {
-        addObj(
-          'segment',
-          [
-            [x, 0],
-            [x, textY]
-          ],
-          { strokeColor: pal.dim, strokeWidth: 1, dash: 1, strokeOpacity: 0.5, layer: 3 }
-        )
-      }
-
-      // 第一行:距离(靠上)
-      addObj('text', [x, textY + maxD * 0.06, `${ptDef.lbl} = ${x.toFixed(1)}m`], {
+      addObj('text', [x, textY - maxD * 0.03, ptDef.lbl], {
         fontSize: 10,
         color: ptDef.c,
         anchorX: 'center',
         anchorY: 'bottom',
         layer: 10
       })
-      // 第二行:声压级(靠下,贴近点)
-      addObj('text', [x, textY, `${spl.toFixed(1)} dB`], {
-        fontSize: 10,
-        color: pal.text,
-        anchorX: 'center',
-        anchorY: 'bottom',
-        layer: 10
+      addObj('point', [-maxD, maxD * (0.9 - 0.1 * index)], {
+        size: 4,
+        fillColor: ptDef.c,
+        strokeColor: pal.bg,
+        strokeWidth: 1.5,
+        layer: 4
       })
+      addObj(
+        'text',
+        [
+          -maxD + 1,
+          maxD * (0.86 - 0.1 * index),
+          `${ptDef.lbl} : ${x.toFixed(1)} m, ${spl.toFixed(1)} dB`
+        ],
+        {
+          fontSize: 11,
+          color: ptDef.c,
+          anchorX: 'center',
+          anchorY: 'bottom',
+          layer: 10
+        }
+      )
     })
   } finally {
     board.unsuspendUpdate()

+ 2 - 0
src/renderer/src/locales/lang/zh_CN.json

@@ -43,6 +43,8 @@
     "vCov": "垂直指向角 (-6 dB)",
     "dir": "安装方式",
     "dirH": "水平安装",
+    "front": "前方(m)",
+    "side":"左右(m)",
     "dirV": "竖直安装",
     "angle": "安装倾斜角(声轴相对听众面)",
     "d1": "近场听音点水平距离",