Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centering the image on the tap #87

Open
MadGeorge opened this issue Jun 11, 2024 · 2 comments
Open

Centering the image on the tap #87

MadGeorge opened this issue Jun 11, 2024 · 2 comments

Comments

@MadGeorge
Copy link

Hello. With a basic setup actionOnTapImageView: Action.zoomToFit presents the zoomed image at the point of the original image. Is it possible to anchor it to the center of the screen when the user taps the original image?

Screenshot 2024-06-11 at 17 10 08

The Setup I'm currently using:

addZoombehavior(
        for: testView.headerView.imageView,
        in: parent?.view ?? view,
        settings: .backgroundEnabledSettings
            .with(zoomCancelingThreshold: 1)
            .with(actionOnTapBackgroundView: Action.dismissOverlay)
            .with(actionOnTapImageView: Action.zoomToFit)
            .with(defaultAnimators: CustomAnimators())
)
@MadGeorge MadGeorge changed the title Center Centering image on tap Jun 11, 2024
@MadGeorge MadGeorge changed the title Centering image on tap Centering the image on the tap Jun 11, 2024
@lvnkmn
Copy link
Owner

lvnkmn commented Jun 11, 2024

Hi George,

I think what you're trying to achieve is possible. But I hope you don't mind I won't dive into the code now.

I honestly don't know by heart & you may need to add a new event as I'm not sure if the tap background image is the correct one.

What may also help, is to zoom within a larger container than you currently do.

Kind regards,
Mennno

@MadGeorge
Copy link
Author

MadGeorge commented Jun 21, 2024

Hello. Thanks for the response. I will try your suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants