xushiting 1 년 전
부모
커밋
5d76beb4be

+ 40 - 0
src/view/case/draw/board/editCAD/Controls/UIControl.js

@@ -267,6 +267,46 @@ export default class UIControl {
               rotate:customImage.angle,
               scale:customImage.scale
           };
+        case VectorType.Circle:
+          const circle = floorplanService.getCircle(item.vectorId);
+          if (!circle) {
+            return;
+          }
+          value = {
+              version:'2.0',
+              type: type,
+              color: circle.color,
+          };
+        case VectorType.Rectangle:
+          const rectangle = floorplanService.getRectangle(item.vectorId);
+          if (!rectangle) {
+            return;
+          }
+          value = {
+              version:'2.0',
+              type: type,
+              color: rectangle.color,
+          };
+        case VectorType.Wall:
+          const wall = floorplanService.getWall(item.vectorId);
+          if (!wall) {
+            return;
+          }
+          value = {
+              version:'2.0',
+              type: type,
+              color: wall.color,
+          };
+        case VectorType.Arrow:
+          const arrow = floorplanService.getArrow(item.vectorId);
+          if (!arrow) {
+            return;
+          }
+          value = {
+              version:'2.0',
+              type: type,
+              color: arrow.color,
+          };
       }
     }
     

+ 2 - 5
src/view/case/draw/board/editCAD/History/HistoryUtil.js

@@ -61,7 +61,7 @@ export default class HistoryUtil {
 
     isDifferentForRectangles(rectangle1, rectangle2) {
         for(let i=0;i<rectangle1.points.length;++i){
-            if(!mathUtil.equalPoint(rectangle1.points[i], rectangle2.points[i]) && rectangle1.color == rectangle2.color){
+            if(!mathUtil.equalPoint(rectangle1.points[i], rectangle2.points[i]) || rectangle1.color != rectangle2.color){
                 return true;
             }
         }
@@ -69,10 +69,7 @@ export default class HistoryUtil {
     }
 
     isDifferentForCircles(circle1, circle2) {
-        if(!mathUtil.equalPoint(circle1.center, circle2.center) && circle1.color == circle2.color){
-            return true;
-        }
-        else if(circle1.radius != circle2.radius){
+        if(!mathUtil.equalPoint(circle1.center, circle2.center) || circle1.color != circle2.color||circle1.radius != circle2.radius){
             return true;
         }
         else {

+ 1 - 6
src/view/case/draw/board/editCAD/Renderer/Draw.js

@@ -52,14 +52,9 @@ export default class Draw {
         this.context.save()
         this.context.beginPath()
         this.context.lineCap = 'round' //线段端点的样式
-        //this.context.lineJoin= 'miter';
-        this.context.strokeStyle = Style.Wall.strokeStyle
 
         this.context.lineWidth = Style.Wall.lineWidth * coordinate.ratio
-        this.context.strokeStyle = Style.Wall.strokeStyle
-        if(vector.color){
-            this.context.strokeStyle = vector.color
-        }
+        this.context.strokeStyle = vector.color
 
         const selectItem = stateService.getSelectItem()
         const draggingItem = stateService.getDraggingItem()