From 00ff07d74f7bed3a715fb40ab627823decae0fb4 Mon Sep 17 00:00:00 2001 From: "zhanning.bzn" Date: Wed, 11 Sep 2019 17:37:25 +0800 Subject: [PATCH] fix zoom-canvas bug --- CHANGELOG.md | 4 ++++ package.json | 2 +- src/behavior/zoom-canvas.js | 5 +++-- src/global.js | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f608133e2..e749e9d8bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # ChangeLog +#### 3.0.7 +`2019-09-11` +* fix: zoom-canvas support IE and Firefox + #### 3.0.6 `2019-09-11` * fix: group data util function use module.exports diff --git a/package.json b/package.json index 06ee11dcd9..b4ec9b092c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@antv/g6", - "version": "3.0.6", + "version": "3.0.7", "description": "graph visualization frame work", "main": "build/g6.js", "homepage": "https://github.com/antvis/g6", diff --git a/src/behavior/zoom-canvas.js b/src/behavior/zoom-canvas.js index 80c34f95c3..b3ba4bc1fc 100644 --- a/src/behavior/zoom-canvas.js +++ b/src/behavior/zoom-canvas.js @@ -3,7 +3,7 @@ const DELTA = 0.05; module.exports = { getDefaultCfg() { return { - sensitivity: 5, + sensitivity: 2, minZoom: 0.1, maxZoom: 10 }; @@ -24,7 +24,8 @@ module.exports = { const pixelRatio = canvas.get('pixelRatio'); const sensitivity = this.get('sensitivity'); let ratio = graph.getZoom(); - if (e.deltaY < 0) { + // 兼容IE、Firefox及Chrome + if (e.wheelDelta < 0) { ratio = 1 - DELTA * sensitivity; } else { ratio = 1 + DELTA * sensitivity; diff --git a/src/global.js b/src/global.js index 8cc7f64aae..b770cd2c14 100755 --- a/src/global.js +++ b/src/global.js @@ -3,7 +3,7 @@ */ module.exports = { - version: '3.0.6', + version: '3.0.7', rootContainerClassName: 'root-container', nodeContainerClassName: 'node-container', edgeContainerClassName: 'edge-container',