-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Use offsetX and offsetY if available #2975
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
Conversation
1d96037
to
2d41688
Compare
And there's also less temporary |
Thanks for any review |
I have not done any testing (not on touch devices and not on IE), but from just looking at the code it looks good. If you can confirm that the relevant interactions and gestures still work on all target browsers and especially Windows Mobile devices, then please merge. |
@@ -592,18 +592,20 @@ ol.Map.prototype.getEventCoordinate = function(event) { | |||
|
|||
|
|||
/** | |||
* Returns the map pixel position for a browser event. | |||
* Returns the map pixel position for a browser event relative the viewport. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
relative to
the viewport.
The code is local and looks reasonable. |
2d41688
to
e2ad38d
Compare
I don't get it. |
Sorry we're talking about |
And in the case where And also, is the |
Because
Yes; firefox (at least) does not provide |
Thanks @fredj! This is very useful information. Information I'd add as comments in the code before merging! Please merge if you agree. |
e2ad38d
to
5c9c1c3
Compare
5c9c1c3
to
fabf059
Compare
Use offsetX and offsetY if available
Very nice. Thanks a lot for the comments you added to the code. This is very useful I think. |
Use the mouse event
offsetX
andoffsetY
properties if available instead of computing the value in javascript. See http://www.w3.org/TR/cssom-view/#dom-mouseevent-pagexCalling
goog.style.getRelativePosition
will cause a reflow (becausegetBoundingClientRect
is called in this function)