Browse Source

Merge branch 'master' of http://192.168.0.115:3000/bill/traffic-laser

xzw 2 years ago
parent
commit
cea0fea1ab
3 changed files with 5 additions and 4 deletions
  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) {
     this.style = style;
   }
-  getStyle() {
-    return this.weight;
-  }
 
   setWeight(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.renderer = new Render(this);
     this.history = new History(this);
-    this.coordinate = coordinate
+    this.coordinate = coordinate;
     this.mousePosition = null;
     this.dragging = false; // 当前是否正在拖拽
     this.start();
@@ -323,6 +323,8 @@ export default class Layer {
             mathUtil.clonePoint(curveLine.points[1], position);
             curveLine.curves = mathUtil.getCurvesByPoints(curveLine.points);
             curveLine.setWeight(weight);
+            const style = line.getStyle();
+            curveLine.setStyle(style);
           } else if (focusItem.type == VectorType.CurveLine) {
             let curveLine = dataService.getCurveLine(focusItem.vectorId);
             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);
       const weight = curveLine.getWeight();
       line.setWeight(weight);
+      const style = curveLine.getStyle();
+      line.setStyle(style);
       this.deleteCurveLine(curveLineId);
     } else {
       curveLine.curves = mathUtil.getCurvesByPoints(curveLine.points);