Selaa lähdekoodia

添加draw类别

bill 2 vuotta sitten
vanhempi
commit
901c48791a
1 muutettua tiedostoa jossa 16 lisäystä ja 9 poistoa
  1. 16 9
      src/graphic/Renderer/Draw.js

+ 16 - 9
src/graphic/Renderer/Draw.js

@@ -31,10 +31,12 @@ const help = {
           // item.type === VectorType[geoType] &&
           geoId === item.vectorId
         ) {
-          const style = Style[attr][geoType] || Style[attr][item.category]
-          if (Style[attr] && style) {
-            currentAttr = attr;
-            return style;
+          if (Style[attr]) {
+            const style = Style[attr][geoType] || Style[attr][item.category]
+            if (style) {
+              currentAttr = attr;
+              return style;
+            }
           }
         }
         return prev;
@@ -522,11 +524,6 @@ export default class Draw {
     }
     ctx.stroke();
     ctx.restore();
-
-    if ([Style.Focus.ArrowLine, Style.Select.ArrowLine].includes(style)) {
-      this.drawPoint(startReal);
-      this.drawPoint(endReal);
-    }
   }
 
   drawMagnifier(vector) {
@@ -751,15 +748,25 @@ export default class Draw {
     this.context.stroke();
     this.context.restore();
 
+    const drawPoints = () => {
+      // if (attr) {
+        this.drawPoint(dataService.getPoint(vector.startId))
+        this.drawPoint(dataService.getPoint(vector.endId))
+      // }
+    }
+
     switch (vector.category) {
       case VectorCategory.Line.ArrowLine:
         this.drawArrow(vector);
+        drawPoints()
         break
       case VectorCategory.Line.BaseLine:
         this.drawBaseLineLabel(vector)
+        drawPoints()
         break;
       case VectorCategory.Line.MeasureLine:
         this.drawLineText(vector, style.text)
+        drawPoints()
         break;
     }