Commit 431d53b6 authored by techird's avatar techird

节点过多关闭动画

parent bbdc42b0
...@@ -76,7 +76,7 @@ KityMinder.registerModule('Connect', { ...@@ -76,7 +76,7 @@ KityMinder.registerModule('Connect', {
'nodedetach': function(e) { 'nodedetach': function(e) {
this.removeConnect(e.node); this.removeConnect(e.node);
}, },
'layoutapply noderender': function(e) { 'layoutapply layoutfinish noderender': function(e) {
this.updateConnect(e.node); this.updateConnect(e.node);
} }
} }
......
...@@ -202,7 +202,7 @@ kity.extendClass(Minder, { ...@@ -202,7 +202,7 @@ kity.extendClass(Minder, {
var me = this; var me = this;
// 节点复杂度大于 100,关闭动画 // 节点复杂度大于 100,关闭动画
// if (root.getComplex() > 100) duration = 0; if (root.getComplex() > 300) duration = 0;
function applyMatrix(node, matrix) { function applyMatrix(node, matrix) {
node.getRenderContainer().setMatrix(node._lastLayoutTransform = matrix); node.getRenderContainer().setMatrix(node._lastLayoutTransform = matrix);
......
...@@ -61,6 +61,7 @@ KityMinder.registerModule('TemplateModule', { ...@@ -61,6 +61,7 @@ KityMinder.registerModule('TemplateModule', {
execute: function(minder, name) { execute: function(minder, name) {
minder.useTemplate(name); minder.useTemplate(name);
minder.execCommand('camera');
}, },
queryValue: function(minder) { queryValue: function(minder) {
......
...@@ -40,6 +40,12 @@ KityMinder.registerModule('Zoom', function() { ...@@ -40,6 +40,12 @@ KityMinder.registerModule('Zoom', function() {
if (!value) return; if (!value) return;
minder._zoomValue = value;
setTextRendering();
if (minder.getRoot().getComplex() > 200) {
return minder.zoom(value);
}
var animator = new kity.Animator({ var animator = new kity.Animator({
beginValue: minder._zoomValue, beginValue: minder._zoomValue,
finishValue: value, finishValue: value,
...@@ -47,11 +53,9 @@ KityMinder.registerModule('Zoom', function() { ...@@ -47,11 +53,9 @@ KityMinder.registerModule('Zoom', function() {
target.zoom(value); target.zoom(value);
} }
}); });
minder._zoomValue = value;
if (timeline) { if (timeline) {
timeline.pause(); timeline.pause();
} }
setTextRendering();
timeline = animator.start(minder, 300, 'easeInOutSine', function() {}); timeline = animator.start(minder, 300, 'easeInOutSine', function() {});
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment