mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-26 07:44:56 +01:00
Fixed node size change bug
This commit is contained in:
parent
830f65caa9
commit
62b3bf8bc0
@ -94,10 +94,13 @@ mindplot.layout.Node = new Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
hasPositionChanged: function() {
|
hasPositionChanged: function() {
|
||||||
|
|
||||||
return this._isPropertyChanged('position');
|
return this._isPropertyChanged('position');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
hasSizeChanged: function() {
|
||||||
|
return this._isPropertyChanged('size');
|
||||||
|
},
|
||||||
|
|
||||||
getPosition: function() {
|
getPosition: function() {
|
||||||
return this._getProperty('position');
|
return this._getProperty('position');
|
||||||
},
|
},
|
||||||
|
@ -89,6 +89,7 @@ mindplot.layout.OriginalLayout = new Class({
|
|||||||
var children = this._treeSet.getChildren(node);
|
var children = this._treeSet.getChildren(node);
|
||||||
var parent = this._treeSet.getParent(node);
|
var parent = this._treeSet.getParent(node);
|
||||||
var childrenOrderMoved = children.some(function(child) { return child.hasOrderChanged(); });
|
var childrenOrderMoved = children.some(function(child) { return child.hasOrderChanged(); });
|
||||||
|
var childrenSizeChanged = children.some(function(child) { return child.hasSizeChanged(); });
|
||||||
|
|
||||||
// If ether any of the nodes has been changed of position or the height of the children is not
|
// If ether any of the nodes has been changed of position or the height of the children is not
|
||||||
// the same, children nodes must be repositioned ....
|
// the same, children nodes must be repositioned ....
|
||||||
@ -98,7 +99,7 @@ mindplot.layout.OriginalLayout = new Class({
|
|||||||
var heightChanged = node._branchHeight != newBranchHeight;
|
var heightChanged = node._branchHeight != newBranchHeight;
|
||||||
node._heightChanged = heightChanged || parentHeightChanged;
|
node._heightChanged = heightChanged || parentHeightChanged;
|
||||||
|
|
||||||
if (childrenOrderMoved || heightChanged || parentHeightChanged) {
|
if (childrenOrderMoved || childrenSizeChanged || heightChanged || parentHeightChanged) {
|
||||||
var sorter = node.getSorter();
|
var sorter = node.getSorter();
|
||||||
var offsetById = sorter.computeOffsets(this._treeSet, node);
|
var offsetById = sorter.computeOffsets(this._treeSet, node);
|
||||||
var parentPosition = node.getPosition();
|
var parentPosition = node.getPosition();
|
||||||
|
Loading…
Reference in New Issue
Block a user