ngx-pinch-zoom icon indicating copy to clipboard operation
ngx-pinch-zoom copied to clipboard

dynamically changing image size and/or window resizing does not adjust zoom level restriction on ivy-pinch-pro-1.4.0

Open danday74 opened this issue 3 years ago • 1 comments

pinch-zoom is intelligent in that it restricts zoom according to the size of the image being wrapper. A larger image will allow more zooming.

I am using pinch-zoom to wrap an image. If I dynamically change the image to a different image, the zoom restriction does not reflect the dimensions of the new image. I have to destroy pinch-zoom and then re-create it using an *ngIf="showPinchZoom" wrapper like so:

<ng-container *ngIf="showPinchZoom">
  <pinch-zoom>
    <image [src]="dynamicallyChangingImageSrc">
  </pinch-zoom>
</ng-container>

Using *ngIf in this manner causes unwanted side effects. Is it possible for the allowable zoom level to update dynamically when the wrapped image src changes? TIA

Note that I have an almost identical problem when resizing the screen. Resizing changes the dimensions of pinch-zoom. Given that pinch-zoom has new dimensions - e.g. it is contained within a smaller div on resize - then the zoom level restriction needs to update to reflect the new dimensions of pinch-zoom but it does not.

Any help with either of these issues? or if these issues are known issues is there any chance of a fix? TIA

danday74 avatar Dec 22 '21 18:12 danday74

Hello, i have similar problems with ngIf, gets wear behavior. I got a blank border after change of ngIf. 7B551A34-3B5E-4639-8BD0-D4352F2BC11B

miguel2211 avatar Aug 30 '22 04:08 miguel2211