mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 14:17:57 +01:00
fixing original layout bugs
This commit is contained in:
parent
4e746833ae
commit
60ab4c7f5d
@ -199,7 +199,12 @@ mindplot.FixedDistanceBoard.prototype.repositionate = function()
|
|||||||
var lowerLimit;
|
var lowerLimit;
|
||||||
if (entries.length > 0)
|
if (entries.length > 0)
|
||||||
{
|
{
|
||||||
var topic = entries[0].getTopic();
|
var l = 0;
|
||||||
|
for(l=0; l<entries.length; l++){
|
||||||
|
if(core.Utils.isDefined(entries[l]))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
var topic = entries[l].getTopic();
|
||||||
var firstNodeHeight = topic.getSize().height;
|
var firstNodeHeight = topic.getSize().height;
|
||||||
lowerLimit = refence.y - (height / 2) - (firstNodeHeight / 2) + 1;
|
lowerLimit = refence.y - (height / 2) - (firstNodeHeight / 2) + 1;
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ mindplot.NodeModel.prototype._removeLink = function(link)
|
|||||||
|
|
||||||
mindplot.NodeModel.prototype.createNote = function(text)
|
mindplot.NodeModel.prototype.createNote = function(text)
|
||||||
{
|
{
|
||||||
core.assert(text, 'note text must be specified.');
|
core.assert(text!=null, 'note text must be specified.');
|
||||||
return new mindplot.NoteModel(text, this);
|
return new mindplot.NoteModel(text, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
mindplot.NoteModel = function(text, topic)
|
mindplot.NoteModel = function(text, topic)
|
||||||
{
|
{
|
||||||
core.assert(text, 'note text can not be null');
|
core.assert(text!=null, 'note text can not be null');
|
||||||
core.assert(topic, 'mindmap can not be null');
|
core.assert(topic, 'mindmap can not be null');
|
||||||
this._text = text;
|
this._text = text;
|
||||||
this._topic = topic;
|
this._topic = topic;
|
||||||
|
@ -25,12 +25,16 @@ mindplot.layoutManagers.OriginalLayoutManager = mindplot.layoutManagers.BaseLayo
|
|||||||
var order = child.getOrder();
|
var order = child.getOrder();
|
||||||
if (!core.Utils.isDefined(order))
|
if (!core.Utils.isDefined(order))
|
||||||
{
|
{
|
||||||
order = maxOrder++;
|
order = ++maxOrder;
|
||||||
|
child.setOrder(order);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(nodesByOrder.hasKey(order)){
|
if(nodesByOrder.hasKey(order)){
|
||||||
|
if(Math.sign(child.getPosition().x) == Math.sign(nodesByOrder.get(order).getPosition().x)){
|
||||||
//duplicated order. Change order to next available.
|
//duplicated order. Change order to next available.
|
||||||
order = maxOrder++;
|
order = ++maxOrder;
|
||||||
|
child.setOrder(order);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
nodesByOrder.set(order, child);
|
nodesByOrder.set(order, child);
|
||||||
if(order>maxOrder)
|
if(order>maxOrder)
|
||||||
@ -40,7 +44,7 @@ mindplot.layoutManagers.OriginalLayoutManager = mindplot.layoutManagers.BaseLayo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
nodesByOrder=null;
|
nodesByOrder=null;
|
||||||
return result;
|
return node.getTopicType()!=mindplot.NodeModel.CENTRAL_TOPIC_TYPE?result:children;
|
||||||
},
|
},
|
||||||
_nodeResizeEvent:function(node){
|
_nodeResizeEvent:function(node){
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user