|
|
@ -73,7 +73,18 @@ export class editPlaneFigureComponent implements OnInit { |
|
|
|
this.details = this.data.buildingData.details || '' |
|
|
|
this.details = this.data.buildingData.details || '' |
|
|
|
this.imgWidth = this.data.buildingData.imageWidth || 0 |
|
|
|
this.imgWidth = this.data.buildingData.imageWidth || 0 |
|
|
|
this.imgHeight = this.data.buildingData.imageHeight || 0 |
|
|
|
this.imgHeight = this.data.buildingData.imageHeight || 0 |
|
|
|
this.imgScale = Number((this.imgWidth/this.imgHeight)) |
|
|
|
if (this.imgWidth==0 && this.imgHeight==0 && this.data.buildingData.imageUrl) { |
|
|
|
|
|
|
|
let that = this |
|
|
|
|
|
|
|
let img = new Image() |
|
|
|
|
|
|
|
img.src = this.data.buildingData.imageUrl |
|
|
|
|
|
|
|
img.onload = function () { |
|
|
|
|
|
|
|
that.imgWidth = img.width |
|
|
|
|
|
|
|
that.imgHeight = img.height |
|
|
|
|
|
|
|
that.imgScale = Number((that.imgWidth/that.imgHeight)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.imgScale = Number((this.imgWidth/this.imgHeight)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => { |
|
|
|
this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => { |
|
|
|
if (event.keyCode === 13) { |
|
|
|
if (event.keyCode === 13) { |
|
|
|