mxGraph全图居中显示
$(".tool-full-map").click(function(){ graph.fit();//自适应 graph.center(true,true,0.5,0.5);//将画布放到容器中间 var sc = graph.getView().getScale(); graph.zoomT
·
$(".tool-full-map").click(function(){
graph.fit();//自适应
graph.center(true,true,0.5,0.5);//将画布放到容器中间
var sc = graph.getView().getScale();//获取当前的缩放比例
graph.zoomTo(Math.round(sc/2));//在缩放一半,否则是满屏状态,不好看
});
graph.fit();//自适应
graph.center(true,true,0.5,0.5);//将画布放到容器中间
var sc = graph.getView().getScale();//获取当前的缩放比例
graph.zoomTo(Math.round(sc/2));//在缩放一半,否则是满屏状态,不好看
});
更多推荐
已为社区贡献1条内容
所有评论(0)