浏览代码

修复bug

xushiting 2 年之前
父节点
当前提交
ca8450350e
共有 3 个文件被更改,包括 5 次插入4 次删除
  1. 0 3
      src/graphic/Geometry/Geometry.js
  2. 3 1
      src/graphic/Layer.js
  3. 2 0
      src/graphic/Service/LineService.js

+ 0 - 3
src/graphic/Geometry/Geometry.js

@@ -103,9 +103,6 @@ export default class Geometry {
   setStyle(style) {
   setStyle(style) {
     this.style = style;
     this.style = style;
   }
   }
-  getStyle() {
-    return this.weight;
-  }
 
 
   setWeight(weight) {
   setWeight(weight) {
     this.weight = weight;
     this.weight = weight;

+ 3 - 1
src/graphic/Layer.js

@@ -56,7 +56,7 @@ export default class Layer {
     this.uiControl = new UIControl(this, newsletter, graphicState);
     this.uiControl = new UIControl(this, newsletter, graphicState);
     this.renderer = new Render(this);
     this.renderer = new Render(this);
     this.history = new History(this);
     this.history = new History(this);
-    this.coordinate = coordinate
+    this.coordinate = coordinate;
     this.mousePosition = null;
     this.mousePosition = null;
     this.dragging = false; // 当前是否正在拖拽
     this.dragging = false; // 当前是否正在拖拽
     this.start();
     this.start();
@@ -323,6 +323,8 @@ export default class Layer {
             mathUtil.clonePoint(curveLine.points[1], position);
             mathUtil.clonePoint(curveLine.points[1], position);
             curveLine.curves = mathUtil.getCurvesByPoints(curveLine.points);
             curveLine.curves = mathUtil.getCurvesByPoints(curveLine.points);
             curveLine.setWeight(weight);
             curveLine.setWeight(weight);
+            const style = line.getStyle();
+            curveLine.setStyle(style);
           } else if (focusItem.type == VectorType.CurveLine) {
           } else if (focusItem.type == VectorType.CurveLine) {
             let curveLine = dataService.getCurveLine(focusItem.vectorId);
             let curveLine = dataService.getCurveLine(focusItem.vectorId);
             let index = mathUtil.getIndexForCurvesPoints(
             let index = mathUtil.getIndexForCurvesPoints(

+ 2 - 0
src/graphic/Service/LineService.js

@@ -258,6 +258,8 @@ export default class LineService {
       let line = this.create(startPoint, endPoint);
       let line = this.create(startPoint, endPoint);
       const weight = curveLine.getWeight();
       const weight = curveLine.getWeight();
       line.setWeight(weight);
       line.setWeight(weight);
+      const style = curveLine.getStyle();
+      line.setStyle(style);
       this.deleteCurveLine(curveLineId);
       this.deleteCurveLine(curveLineId);
     } else {
     } else {
       curveLine.curves = mathUtil.getCurvesByPoints(curveLine.points);
       curveLine.curves = mathUtil.getCurvesByPoints(curveLine.points);