Browse Source

[完善] 正确获取可视区域宽高

develop
陈鹏飞 4 years ago
parent
commit
343c69992d
  1. 4
      src/app/ui/collection-tools/collection-tools.component.ts

4
src/app/ui/collection-tools/collection-tools.component.ts

@ -1116,8 +1116,8 @@ export class CollectionToolsComponent implements OnInit {
//计算 可视区域内宽度, 是否缩放背景图
backGroundScale () {
let that = this
let dadWidth = document.querySelector('.canvas').clientWidth
let dadHeight = document.querySelector('.canvas').clientHeight
let dadWidth = this.element.nativeElement.querySelector('.canvas').clientWidth
let dadHeight = this.element.nativeElement.querySelector('.canvas').clientHeight
let img = new Image()
img.src = this.selectingSitePlan.imageUrl;
img.onload = function(){

Loading…
Cancel
Save