fix zoom-canvas bug

This commit is contained in:
zhanning.bzn 2019-09-11 17:37:25 +08:00
parent 902d52b17b
commit 00ff07d74f
4 changed files with 9 additions and 4 deletions

View File

@ -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

View File

@ -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",

View File

@ -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;

View File

@ -3,7 +3,7 @@
*/
module.exports = {
version: '3.0.6',
version: '3.0.7',
rootContainerClassName: 'root-container',
nodeContainerClassName: 'node-container',
edgeContainerClassName: 'edge-container',