Skip to content

fix(bounds): support optional maxBounds for stricter position constraints #541

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sheikhshaheerimran
Copy link

This PR fix support for optional maxBounds in the pan/zoom calculation logic, allowing users to define stricter movement constraints beyond the existing limitToBounds behavior.

Why This Change
Previously, limitToBounds only used internally calculated bounds and ignored explicitly defined minPositionX, minPositionY, maxPositionX, and maxPositionY. This limited the developer's control over how far the content could pan or zoom.

…ints

Allows users to define max bounds for pan/zoom behavior. This improves control over movement limits when the default limitToBounds is not sufficient. Previously, min and max positions for X and Y were not used to constrain the image bounds.
@sheikhshaheerimran sheikhshaheerimran force-pushed the fix/bounds-min-max-limits branch from 4b4efa1 to 56f4124 Compare June 21, 2025 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant