Do not dispatch move event if no mouse move (#78) #79

Open
wants to merge 1 commit into
from

Projects

None yet

3 participants

@leplatrem

No description provided.

@mbostock mbostock commented on the diff May 13, 2011
src/Map.js
@@ -185,6 +185,7 @@ po.map = function() {
};
map.panBy = function(x) {
+ if (x.x == 0 && x.y == 0) return;
@mbostock
mbostock May 13, 2011 Contributor

The panBy method is used by zoomBy, and the latter assumes that panBy will always dispatch an event. If that's not the case, then we'll need some additional logic in zoomBy to dispatch an event, or we'll need an internal panning method that does the pan but not the dispatch… So, it's a bit more complicated than this simple fix. :)

@leplatrem
leplatrem May 19, 2011

Thank you for your feedback !
... you're right then, it is not as simple as it looked at first sight.

@jmarca
jmarca commented on 2fd824b Dec 8, 2011

cool. this has been bugging me and I've never gotten around to fixing it myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment