Skip to content

Commit

Permalink
Emit end event after last zoom which had an effect
Browse files Browse the repository at this point in the history
  • Loading branch information
Herst authored Jul 24, 2019
1 parent 6f8b119 commit a1e4e3c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,18 +225,18 @@ export default function() {
k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))),
p = mouse(this);

// If this wheel event won’t trigger a transform change, ignore it.
if (t.k === k) return;

// If the mouse is in the same location as before, reuse it.
// If there were recent wheel events, reset the wheel idle timeout.
if (g.wheel) {
else if (g.wheel) {
if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) {
g.mouse[1] = t.invert(g.mouse[0] = p);
}
clearTimeout(g.wheel);
}

// If this wheel event won’t trigger a transform change, ignore it.
else if (t.k === k) return;

// Otherwise, capture the mouse point and location at the start.
else {
g.mouse = [p, t.invert(p)];
Expand Down

0 comments on commit a1e4e3c

Please sign in to comment.