xushiting преди 2 години
родител
ревизия
a7538b90db

+ 7 - 5
src/views/draw-file/board/editCAD/Controls/UIControl.js

@@ -267,12 +267,14 @@ export default class UIControl{
 
     //截图
     menu_screenShot(fileName) {
-        this.menu_flex();
+        // this.menu_flex();
+        // this.layer.stopAddVector()
+        // setTimeout(function(){
+        //     this.downloadCadImg(this.layer.canvas,fileName)
+        // }.bind(this),100)
+
         this.layer.stopAddVector()
-        setTimeout(function(){
-            this.downloadCadImg(this.layer.canvas,fileName)
-        }.bind(this),100)
-        
+        return this.downloadCadImg(this.layer.canvas,fileName)
     }
 
     menu_flex() {

+ 2 - 3
src/views/draw-file/board/editCAD/Geometry/Image.js

@@ -18,8 +18,7 @@ export default class Image extends Geometry {
         img.src = src;
         img.crossOrigin=""
         img.onload = function () {
-            
-        }
-        this.image = img;
+            this.image = img;
+        }.bind(this)
     }
 }

+ 2 - 2
src/views/draw-file/board/editCAD/Geometry/Table.js

@@ -174,11 +174,11 @@ export default class Table extends Geometry {
         let width = 0;
         const cell = floorplanService.getCell(vectorId)
         for(let i=0;i<cell.rowIndex;++i){
-            const _cell = floorplanService.getCell(this.cells[cell.rowIndex][0])
+            const _cell = floorplanService.getCell(this.cells[i][0])
             height += _cell.height;
         }
         for(let i=0;i<cell.colIndex;++i){
-            const _cell = floorplanService.getCell(this.cells[0][cell.colIndex])
+            const _cell = floorplanService.getCell(this.cells[0][i])
             width += _cell.width;
         }
 

+ 1 - 1
src/views/draw-file/board/editCAD/Renderer/Draw.js

@@ -841,7 +841,7 @@ export default class Draw {
         }
 
         this.context.translate(geometry.center.x,geometry.center.y)
-        this.context.rotate((geometry.angle) * Math.PI)
+        this.context.rotate((geometry.angle)/180 * Math.PI)
         if(geometry.angle == 90){
             this.context.translate( 32/2,  -52)
         }