bill hace 2 años
padre
commit
71cb8337a6

+ 5 - 0
src/graphic/CanvasStyle/default.js

@@ -108,6 +108,10 @@ const NormalLine = {
   strokeStyle: "#000",
   lineWidth: 2 * coordinate.ratio,
 };
+const CurveLine = {
+  ...NormalLine
+}
+
 const GuideLine = {
   strokeStyle: "#CED806",
   lineWidth: 2 * coordinate.ratio,
@@ -201,6 +205,7 @@ export default {
   Circle,
   Text,
   CrossPoint,
+  CurveLine,
   CurveRoadPoint,
   GuideLine,
   Magnifier,

+ 6 - 0
src/graphic/CanvasStyle/focus.js

@@ -28,6 +28,11 @@ const NormalLine = {
   lineWidth: 2 * coordinate.ratio,
   strokeStyle: "#3290FF",
 };
+const CurveLine = {
+  ...def.CurveLine,
+  lineWidth: 2 * coordinate.ratio,
+  strokeStyle: "#3290FF",
+};
 
 const Magnifier = {
   ...def.Magnifier,
@@ -123,6 +128,7 @@ export default {
   MeasureLine,
   TestPoint,
   Circle,
+  CurveLine,
   RoadEdge,
   Magnifier,
   BaseLine,

+ 6 - 0
src/graphic/CanvasStyle/select.js

@@ -33,6 +33,11 @@ const NormalLine = {
   lineWidth: 2 * coordinate.ratio,
   strokeStyle: "#3290FF",
 };
+const CurveLine = {
+  ...def.CurveLine,
+  lineWidth: 2 * coordinate.ratio,
+  strokeStyle: "#3290FF",
+};
 const ArrowLine = {
   lineWidth: 2 * coordinate.ratio,
   strokeStyle: "red",
@@ -120,6 +125,7 @@ export default {
   MeasureLine,
   BasePoint,
   BaseLine,
+  CurveLine,
   Circle,
   RoadEdge,
   NormalLine,

+ 13 - 1
src/graphic/Renderer/Draw.js

@@ -805,7 +805,19 @@ export default class Draw {
     );
   }
 
-  drawCurveLine() {}
+  drawCurveLine(vector) {
+    // points  CurveLine
+    console.log(vector)
+    const ctx = this.context;
+    ctx.save();
+    help.setVectorStyle(ctx, vector);
+    help.drawCoves(ctx, help.transformCoves([vector.points]));
+    ctx.restore();
+
+    if (import.meta.env.DEV) {
+      vector.points.forEach(this.drawPoint.bind(this));
+    }
+  }
 
   drawLine(vector) {
     const startReal = dataService.getPoint(vector.startId);