-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
.getBounds().pad() not working with negative values #5741
Comments
I beleive that should fix the issue. However it may give a new issue as it does not check if the value is <-100 or >100. Edit: The pull didn't pass the Travis CI because the expected values were set with the "broken" version |
I think the issue here is your understanding of what the function does. The parameter |
@danzel Ya you're right I tested it on the leaflet main page with rectangles as you can see in my mspaint pic You can close/deny my pull request as I see what the function is for now. I am unsure of if we should add a new function for percentResize but I would be willing to add it :) |
I don't think this is a bug, it's just a misunderstanding of what the method does, and the fact that we are using the word "percentage" in the docstrings rather than "ratio". Some clarification in the docstrings for that method (e.g. @CalvinWilliams1012, maybe you would like to make such a change in the documentation? |
@IvanSanchez I am not sure how this projects doc's work yet I hope that comment is fine on multiple lines if not I can put it on one line, even though that makes it look gross :) |
@CalvinWilliams1012 I think #5748 looks good enough. You can always run |
This referes to a 2 year old issue found here:
#2673
The problem:
When passing negative values into the .pad() function, the result is not smaller than the current map container (-10 and 10 produce results that differ only slightly in size, but are both bigger than the map)
Steps to reproduce:
Open the leaflet homepage map
Enter:
into the console
Zoom out, see two rectangles bigger than the actual map at the time of drawing.
The text was updated successfully, but these errors were encountered: