Skip to content

Commit 75c0957

Browse files
committed
Make scroll delta work on Firefox and Chrome
1 parent fc77121 commit 75c0957

File tree

1 file changed

+6
-1
lines changed
  • lib/matplotlib/backends/web_backend

1 file changed

+6
-1
lines changed

lib/matplotlib/backends/web_backend/mpl.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,12 @@ mpl.figure.prototype._init_canvas = function() {
149149
canvas_div.on("wheel mousewheel", function (event) {
150150
event = event.originalEvent;
151151
event['data'] = 'scroll'
152-
event.step = -event.deltaY / 3.
152+
if (event.deltaY < 0) {
153+
event.step = 1;
154+
} else {
155+
event.step = -1;
156+
}
157+
console.log(event.step);
153158
mouse_event_fn(event);
154159
});
155160

0 commit comments

Comments
 (0)