|
|
|
@ -950,14 +950,15 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
img.src = this.selectingSitePlan.imageUrl;
|
|
|
|
|
img.onload = function(){ |
|
|
|
|
if (img.height > dadHeight && img.width > imgWidth) { |
|
|
|
|
let number = (dadHeight/img.height + imgWidth/img.width) / 2 |
|
|
|
|
that.canvas.setBackgroundScale(number-0.015) |
|
|
|
|
let width = imgWidth/img.width |
|
|
|
|
let height = dadHeight/img.height |
|
|
|
|
that.canvas.setBackgroundScale((width>height? height : width)-0.005) |
|
|
|
|
return |
|
|
|
|
} else if (img.height > dadHeight) { |
|
|
|
|
that.canvas.setBackgroundScale((dadHeight/img.height)-0.01) |
|
|
|
|
that.canvas.setBackgroundScale((dadHeight/img.height)-0.005) |
|
|
|
|
return |
|
|
|
|
} else if (img.width > imgWidth) { |
|
|
|
|
that.canvas.setBackgroundScale((imgWidth/img.width)-0.01) |
|
|
|
|
that.canvas.setBackgroundScale((imgWidth/img.width)-0.005) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|