feat: fix node or edge size, fontSize, lineWidth while zooming graph with zoom-canvas.

This commit is contained in:
Yanyan-Wang 2020-07-13 15:15:11 +08:00 committed by baizn
parent b2fec65c93
commit 7c93298919
3 changed files with 6 additions and 1 deletions

View File

@ -127,4 +127,4 @@
"webpack-cli": "^3.3.10",
"worker-loader": "^2.0.0"
}
}
}

View File

@ -48,6 +48,9 @@ export default {
let zoom = graphZoom;
// 兼容IE、Firefox及Chrome
if (e.wheelDelta < 0) {
// ratio = 1 - DELTA * sensitivity;
// ratio = graphZoom - DELTA * sensitivity;
// zoom = graphZoom * ratio;
ratio = 1 - DELTA * sensitivity;
} else {
ratio = 1 / (1 - DELTA * sensitivity);

View File

@ -310,6 +310,8 @@ export const shapeBase: ShapeOptions = {
const style = styles[key];
if (isPlainObject(style)) {
const subShape = group.find((element) => element.get('name') === key);
if (subShape) {
subShape.attr(style);
}