Skip to content

Commit 7edf9a3

Browse files
Merge pull request jacomyal#791 from robindemourat/master
fix unexpected zoom behaviors on macbook pro trackpads fix jacomyal#790
2 parents 31cc1ee + ea4903e commit 7edf9a3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/captors/sigma.captors.mouse.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,11 @@
316316
function _wheelHandler(e) {
317317
var pos,
318318
ratio,
319-
animation;
319+
animation,
320+
wheelDelta = sigma.utils.getDelta(e);
320321

321-
if (_settings('mouseEnabled') && _settings('mouseWheelEnabled')) {
322-
ratio = sigma.utils.getDelta(e) > 0 ?
322+
if (_settings('mouseEnabled') && _settings('mouseWheelEnabled') && wheelDelta !== 0) {
323+
ratio = wheelDelta > 0 ?
323324
1 / _settings('zoomingRatio') :
324325
_settings('zoomingRatio');
325326

0 commit comments

Comments
 (0)