BetterTyped / react-zoom-pan-pinch

🖼 React library to support easy zoom, pan, pinch on various html dom elements like <img> and <div>
MIT License
1.48k stars 268 forks source link

re:limitToBounds on resize #433

Open afgarcia86 opened 10 months ago

afgarcia86 commented 10 months ago

Describe the bug In full screen, if I zoom & pan to the bottom left corner for example, when I scale the view down I often see negative space on the bottom because of the coordinates before scaling. Once I tap the component it seems to auto adjust to the ideal coordinates for the scale. Is there a way to automatically trigger this adjustment onResize?

Screenshots full screen: image scaled down: image after tap: image

asdev-team commented 8 months ago

use disablePadding={ true }

afgarcia86 commented 8 months ago

So I have that set, it doesn't have padding unless I resize the browser window. And it snaps back into place once I click on the view.

mycob commented 1 month ago

So I have that set, it doesn't have padding unless I resize the browser window. And it snaps back into place once I click on the view.

@afgarcia86 Did you ever figure this out by any chance? I'm having the same issue with having too much white space/padding.

afgarcia86 commented 1 month ago

So I have that set, it doesn't have padding unless I resize the browser window. And it snaps back into place once I click on the view.

@afgarcia86 Did you ever figure this out by any chance? I'm having the same issue with having too much white space/padding.

Sadly not yet I have just been ignoring it so far. I would be satisfied with a way to programmatically trigger a click.

mycob commented 1 month ago

So I have that set, it doesn't have padding unless I resize the browser window. And it snaps back into place once I click on the view.

@afgarcia86 Did you ever figure this out by any chance? I'm having the same issue with having too much white space/padding.

Sadly not yet I have just been ignoring it so far. I would be satisfied with a way to programmatically trigger a click.

I hear ya. I'll be sure to share if I come up with anything. Thanks.