xushiting 1 year ago
parent
commit
02a2fa2f32

+ 6 - 1
src/view/case/draw/board/editCAD/Controls/UIControl.js

@@ -284,7 +284,12 @@ export default class UIControl {
           if (!compass) {
             return;
           }
-          value = compass.angle;
+          //value = compass.angle;
+          value = {
+            version:'2.0',
+            type: type,
+            rotate:compass.angle
+          };
           break;
         case VectorType.CustomImage:
           const customImage = floorplanService.getCustomImage(item.vectorId);

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

@@ -29,6 +29,11 @@ export default class History {
         this.bus.emit('undoAvailable', false)
     }
 
+    clear(){
+        change.lastData = {}; 
+        change.elements = {}; 
+    }
+
     save() {
         const flag = change.operate()
         if (!flag) {

+ 1 - 1
src/view/case/draw/board/editCAD/Layer.js

@@ -182,7 +182,7 @@ export default class Layer {
         break;
       case LayerEvents.PanBackGround:
         break;
-      case LayerEvents.ModifyBgImage:
+      case LayerEvents.MoveBgImage:
         needAutoRedraw = true;
         if (draggingItem != null) {
           moveCustomImage.moveFullCustomImage(dx, dy, draggingItem.vectorId);

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

@@ -212,7 +212,7 @@ export default class Draw {
             }
         }
 
-        this.context.font = `400 ${geometry.fontSize}px Microsoft YaHei`
+        this.context.font = `400 ${geometry.fontSize* coordinate.ratio}px Microsoft YaHei`
 
         //根据文字的长度,更新标注范围
         //geometry.sideWidth = Math.max(this.context.measureText(geometry.value).width, this.context.measureText(parseFloat(geometry.value).toFixed(2)).width)
@@ -287,9 +287,8 @@ export default class Draw {
     }
 
     drawCell(geometry,width,height){
-
         this.context.save()
-        this.context.lineWidth = Style.Table.lineWidth 
+        this.context.lineWidth = Style.Table.lineWidth * coordinate.ratio
         this.context.strokeStyle = Style.Table.strokeStyle
         this.context.fillStyle = Style.Table.fillStyle
 
@@ -459,7 +458,10 @@ export default class Draw {
         const pt = coordinate.getScreenXY(geometry.center)
 
         this.context.save()
+        
+        this.context.lineWidth = Style.Circle.lineWidth * coordinate.ratio
         this.context.strokeStyle = geometry.color
+
         const selectItem = stateService.getSelectItem()
         const draggingItem = stateService.getDraggingItem()
         const focusItem = stateService.getFocusItem()
@@ -1097,7 +1099,7 @@ export default class Draw {
         this.context.font = 12*coordinate.ratio+`px Microsoft YaHei`
         let value = '角度:'+geometry.angle + '°';
         let fontWidth = this.context.measureText(value).width
-        this.context.fillText(value, (geometry.center.x*coordinate.ratio-fontWidth/5), (geometry.center.y+70)*coordinate.ratio)
+        this.context.fillText(value, (geometry.center.x*coordinate.ratio-fontWidth/5), (geometry.center.y+85)*coordinate.ratio)
         this.context.restore()
     }