Skip to content

Conversation

mohlendo
Copy link

@mohlendo mohlendo commented Dec 6, 2012

With this fix leaflet creates accurate mouse events when the map-div has css borders.


//add borders
top += parseInt(L.DomUtil.getStyle(el, "borderTopWidth"), 10) || 0;
left += parseInt(L.DomUtil.getStyle(el, "borderLeftWidth"), 10) || 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix the whitespace here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sorry. Please see commit cf883a0

@mourner
Copy link
Member

mourner commented Dec 10, 2012

Yeah, great catch — and quite surprising that no one noticed this until now. Probably because must users use 1px border so it's not very noticeable. :) Merging and hope it won't affect performance too much.

@mourner mourner closed this Dec 10, 2012
@mourner mourner reopened this Dec 10, 2012
mourner added a commit that referenced this pull request Dec 10, 2012
Fixes Issue 1204: Adds the border width to the viewport offset calculation
@mourner mourner merged commit 236b8fb into Leaflet:master Dec 10, 2012
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

Successfully merging this pull request may close these issues.

2 participants