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

Clamp cannot be turned off #451

Open
LucaSaraCzudar opened this issue Jul 6, 2023 · 1 comment
Open

Clamp cannot be turned off #451

LucaSaraCzudar opened this issue Jul 6, 2023 · 1 comment

Comments

@LucaSaraCzudar
Copy link

Hi, I have a use case where I need to be able to dynamically turn the clamping on and off based on my displayed content.
The documentation says: "NOTES: clamp is disabled if called with no options", but this seems to not work at all. The panning is still restricted, only my previously passed config seems to go away.
This can also be reproduced if I just call .clamp() as-is for the first time on the view, the panning is already restricted. I tried to play around with the screenWidth, screenHeight, worldWidth, and worldHeight properties as well (since my worldWidth and worldHeight would be 0 otherwise) but that didn't help either.
Is this a bug or am I missing something?

@Pettor
Copy link

Pettor commented Feb 11, 2024

I had the same issue. Solved it by using viewport.plugins.remove("clamp"); instead of sending no options.

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