浏览代码

修复bug

xushiting 2 年之前
父节点
当前提交
2b6bb75de0

文件差异内容过多而无法显示
+ 1 - 1
server/test/a0k4xu045_202305311600080410/attach/sceneStore


+ 32 - 27
src/graphic/Controls/MovePoint.js

@@ -217,38 +217,43 @@ export default class MovePoint {
 
 
   updateFixPoint(position, fixPointId) {
   updateFixPoint(position, fixPointId) {
     let fixPoint = dataService.getPoint(fixPointId);
     let fixPoint = dataService.getPoint(fixPointId);
-    let basePoint = dataService.getPoint(fixPoint.linkedBasePointId);
+
     let baseLine = dataService.getLine(Settings.baseLineId);
     let baseLine = dataService.getLine(Settings.baseLineId);
-    let startPoint = dataService.getPoint(baseLine.startId);
-    let endPoint = dataService.getPoint(baseLine.endId);
+    if (baseLine) {
+      let startPoint = dataService.getPoint(baseLine.startId);
+      let endPoint = dataService.getPoint(baseLine.endId);
 
 
-    let baseLineGeometry = mathUtil.createLine1(startPoint, endPoint);
-    let vLine = mathUtil.getVerticalLine(baseLineGeometry, position);
-    let join = mathUtil.getIntersectionPoint(baseLineGeometry, vLine);
+      let baseLineGeometry = mathUtil.createLine1(startPoint, endPoint);
+      let vLine = mathUtil.getVerticalLine(baseLineGeometry, position);
+      let join = mathUtil.getIntersectionPoint(baseLineGeometry, vLine);
 
 
-    let parent = fixPoint.getParent();
-    for (let key in parent) {
-      let line = dataService.getLine(key);
-      if (line.getCategory() == VectorCategory.Line.LocationLineByFixPoint) {
-        let otherPointId = line.getOtherPointId(fixPointId);
-        let otherPoint = dataService.getPoint(otherPointId);
-        mathUtil.clonePoint(otherPoint, join);
-      } else if (line.getCategory() == VectorCategory.Line.GuideLocationLine) {
-        let otherPointId = line.getOtherPointId(fixPointId);
-        let otherPoint = dataService.getPoint(otherPointId);
-        let line2 = mathUtil.createLine3(baseLineGeometry, otherPoint);
-        join = mathUtil.getIntersectionPoint(line2, vLine);
-        mathUtil.clonePoint(otherPoint, join);
-      } else if (
-        line.getCategory() == VectorCategory.Line.ExtendedPositionLine
-      ) {
-        let otherPointId = line.getOtherPointId(fixPointId);
-        let otherPoint = dataService.getPoint(otherPointId);
-        let line2 = mathUtil.createLine3(baseLineGeometry, fixPoint);
-        join = mathUtil.getJoinLinePoint(otherPoint, line2);
-        mathUtil.clonePoint(otherPoint, join);
+      let parent = fixPoint.getParent();
+      for (let key in parent) {
+        let line = dataService.getLine(key);
+        if (line.getCategory() == VectorCategory.Line.LocationLineByFixPoint) {
+          let otherPointId = line.getOtherPointId(fixPointId);
+          let otherPoint = dataService.getPoint(otherPointId);
+          mathUtil.clonePoint(otherPoint, join);
+        } else if (
+          line.getCategory() == VectorCategory.Line.GuideLocationLine
+        ) {
+          let otherPointId = line.getOtherPointId(fixPointId);
+          let otherPoint = dataService.getPoint(otherPointId);
+          let line2 = mathUtil.createLine3(baseLineGeometry, otherPoint);
+          join = mathUtil.getIntersectionPoint(line2, vLine);
+          mathUtil.clonePoint(otherPoint, join);
+        } else if (
+          line.getCategory() == VectorCategory.Line.ExtendedPositionLine
+        ) {
+          let otherPointId = line.getOtherPointId(fixPointId);
+          let otherPoint = dataService.getPoint(otherPointId);
+          let line2 = mathUtil.createLine3(baseLineGeometry, fixPoint);
+          join = mathUtil.getJoinLinePoint(otherPoint, line2);
+          mathUtil.clonePoint(otherPoint, join);
+        }
       }
       }
     }
     }
+
     mathUtil.clonePoint(fixPoint, position);
     mathUtil.clonePoint(fixPoint, position);
     moveText.moveFullText(position, fixPoint.linkedTextId);
     moveText.moveFullText(position, fixPoint.linkedTextId);
   }
   }

+ 4 - 1
src/graphic/Layer.js

@@ -1138,7 +1138,10 @@ export default class Layer {
         addLine.finish(position);
         addLine.finish(position);
         this.updateForLocation();
         this.updateForLocation();
         //绘制的是基准线
         //绘制的是基准线
-        if (Settings.baseLineId == addLine.newLine.vectorId) {
+        if (
+          addLine.newLine &&
+          Settings.baseLineId == addLine.newLine.vectorId
+        ) {
           stateService.clearEventName();
           stateService.clearEventName();
           this.history.save();
           this.history.save();
         }
         }

+ 2 - 1
src/graphic/Load.js

@@ -98,7 +98,8 @@ export default class Load {
           point.setDisplay(dataLocal.points[key].display);
           point.setDisplay(dataLocal.points[key].display);
           point.setLocationMode(dataLocal.points[key].locationMode);
           point.setLocationMode(dataLocal.points[key].locationMode);
           point.setLinkedBasePointId(dataLocal.points[key].linkedBasePointId);
           point.setLinkedBasePointId(dataLocal.points[key].linkedBasePointId);
-          point.linkedTextId == dataLocal.points[key].linkedTextId;
+          point.setColor(point.getColor());
+          point.linkedTextId = dataLocal.points[key].linkedTextId;
         }
         }
 
 
         // let points = dataService.vectorData.points;
         // let points = dataService.vectorData.points;