浏览代码

修复bug:http://192.168.0.21/index.php?m=bug&f=view&bugID=42330

xushiting 1 年之前
父节点
当前提交
32a9095bc6

+ 2 - 0
src/view/case/draw/board/editCAD/Geometry/BgImage.js

@@ -7,6 +7,8 @@ export default class BgImage extends Geometry {
         this.src = src;
         //this.src = src;
         this.image = null;
+        this.width = 540;
+        this.height = 390;
         this.floor = floor?floor:0
         this.geoType = VectorType.BgImage
         this.setId(vectorId)

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

@@ -834,7 +834,13 @@ export default class Draw {
                 geometry.image = img;
             }
             else{
-                this.context.drawImage(geometry.image, pt.x, pt.y, geometry.image.width, geometry.image.height)
+                if(geometry.hasOwnProperty('width')){
+                    this.context.drawImage(geometry.image, pt.x, pt.y, geometry.width, geometry.height)
+                }
+                else{
+                    this.context.drawImage(geometry.image, pt.x, pt.y, geometry.image.width, geometry.image.height)
+                }
+                
             }
             this.context.restore()
         }