xushiting 2 سال پیش
والد
کامیت
41e7ac3fc2
1فایلهای تغییر یافته به همراه30 افزوده شده و 15 حذف شده
  1. 30 15
      src/graphic/Service/ElementService.js

+ 30 - 15
src/graphic/Service/ElementService.js

@@ -49,31 +49,46 @@ export class ElementService {
 
     this.newLineStart = new Point({ x: 0, y: 0 });
     this.newLineEnd = new Point({ x: 1, y: 1 });
-    this.newLine = new Line(this.newLineStart, this.newLineEnd);
+    this.newLine = new Line(
+      this.newLineStart.vectorId,
+      this.newLineEnd.vectorId
+    );
     this.newLine.setCategory(VectorCategory.Line.NormalLine);
     this.newLine.name = ElementEvents.NewLine;
 
     this.checkLinesXStart = new Point({ x: 0, y: 0 });
     this.checkLinesXEnd = new Point({ x: 1, y: 1 });
-    this.checkLines.X = new Line(this.checkLinesXStart, this.checkLinesXEnd);
+    this.checkLines.X = new Line(
+      this.checkLinesXStart.vectorId,
+      this.checkLinesXEnd.vectorId
+    );
     this.newLine.setCategory(VectorCategory.Line.GuideLine);
     this.checkLines.X.name = ElementEvents.CheckLinesX;
 
     this.checkLinesYStart = new Point({ x: 0, y: 0 });
     this.checkLinesYEnd = new Point({ x: 1, y: 1 });
-    this.checkLines.Y = new Line(this.checkLinesYStart, this.checkLinesYEnd);
+    this.checkLines.Y = new Line(
+      this.checkLinesYStart.vectorId,
+      this.checkLinesYEnd.vectorId
+    );
     this.newLine.setCategory(VectorCategory.Line.GuideLine);
     this.checkLines.Y.name = ElementEvents.CheckLinesY;
 
     this.vCheckLinesXStart = new Point({ x: 0, y: 0 });
     this.vCheckLinesXEnd = new Point({ x: 1, y: 1 });
-    this.vCheckLines.X = new Line(this.vCheckLinesXStart, this.vCheckLinesXEnd);
+    this.vCheckLines.X = new Line(
+      this.vCheckLinesXStart.vectorId,
+      this.vCheckLinesXEnd.vectorId
+    );
     this.newLine.setCategory(VectorCategory.Line.GuideLine);
     this.vCheckLines.X.name = ElementEvents.VCheckLinesX;
 
     this.vCheckLinesYStart = new Point({ x: 0, y: 0 });
     this.vCheckLinesYEnd = new Point({ x: 1, y: 1 });
-    this.vCheckLines.Y = new Line(this.vCheckLinesYStart, this.vCheckLinesYEnd);
+    this.vCheckLines.Y = new Line(
+      this.vCheckLinesYStart.vectorId,
+      this.vCheckLinesYEnd.vectorId
+    );
     this.newLine.setCategory(VectorCategory.Line.GuideLine);
     this.vCheckLines.Y.name = ElementEvents.VCheckLinesY;
 
@@ -171,8 +186,8 @@ export class ElementService {
   }
 
   setNewLine(point1, point2) {
-    this.newLineStart.setPositions(point1);
-    this.newLineEnd.setPositions(point2);
+    this.newLineStart.setPosition(point1);
+    this.newLineEnd.setPosition(point2);
   }
 
   showNewLine() {
@@ -196,8 +211,8 @@ export class ElementService {
   }
 
   setCheckLinesX(point1, point2) {
-    this.checkLinesXStart.setPositions(point1);
-    this.checkLinesXEnd.setPositions(point2);
+    this.checkLinesXStart.setPosition(point1);
+    this.checkLinesXEnd.setPosition(point2);
   }
 
   showCheckLinesY() {
@@ -209,8 +224,8 @@ export class ElementService {
   }
 
   setCheckLinesY(point1, point2) {
-    this.checkLinesYStart.setPositions(point1);
-    this.checkLinesYEnd.setPositions(point2);
+    this.checkLinesYStart.setPosition(point1);
+    this.checkLinesYEnd.setPosition(point2);
   }
 
   showVCheckLinesX() {
@@ -222,8 +237,8 @@ export class ElementService {
   }
 
   setVCheckLinesX(point1, point2) {
-    this.vCheckLinesXStart.setPositions(point1);
-    this.vCheckLinesXEnd.setPositions(point2);
+    this.vCheckLinesXStart.setPosition(point1);
+    this.vCheckLinesXEnd.setPosition(point2);
   }
 
   showVCheckLinesY() {
@@ -235,8 +250,8 @@ export class ElementService {
   }
 
   setVCheckLinesY(point1, point2) {
-    this.vCheckLinesYStart.setPositions(point1);
-    this.vCheckLinesYEnd.setPositions(point2);
+    this.vCheckLinesYStart.setPosition(point1);
+    this.vCheckLinesYEnd.setPosition(point2);
   }
 
   hideAll() {