zooming of image is modified
This commit is contained in:
parent
17f9af17aa
commit
5512723950
|
@ -171,14 +171,7 @@
|
|||
*ngIf="fileDownloadUrl"
|
||||
[src]="fileDownloadUrl"
|
||||
[style.width]="'auto'"
|
||||
[style.height]="
|
||||
naturalHeight > imageContainer.clientHeight
|
||||
? ((imageContainer.clientHeight - 20) / naturalHeight) *
|
||||
(zoomRatio / 100) *
|
||||
naturalHeight +
|
||||
'px'
|
||||
: naturalHeight + 'px'
|
||||
"
|
||||
[style.height]="getImageHeight(imageContainer.clientHeight)"
|
||||
(load)="onLoadFileDownloadUrl(downloadImage)"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -82,4 +82,14 @@ export class ImageViewerComponent implements OnInit {
|
|||
|
||||
this.changeDetectorRef.detectChanges();
|
||||
}
|
||||
|
||||
getImageHeight(containerHeight: number): string {
|
||||
const realContainerHeight = containerHeight - 20;
|
||||
const oriHeight =
|
||||
this.naturalHeight > realContainerHeight
|
||||
? realContainerHeight
|
||||
: this.naturalHeight;
|
||||
|
||||
return oriHeight * (this.zoomRatio / 100) + 'px';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user