diff -r 2f002657dada -r 6e4b586aa88a branchobj.cpp --- a/branchobj.cpp Tue May 26 11:24:51 2009 +0000 +++ b/branchobj.cpp Wed Jun 03 20:37:17 2009 +0000 @@ -130,13 +130,14 @@ // m is position of mouse pointer // offset 0: default 1: below lmo -1 above lmo (if possible) - + BranchItem *pi=(BranchItem*)(lmo->getTreeItem()->parent()); + int pi_depth=pi->depth(); BranchObj* o=(BranchObj*)(lmo); if (!parObjTmpBuf) parObjTmpBuf=parObj; // ignore mapcenter and mainbranch - if (treeItem->depth()<2) off=0; + if (pi_depth<2) off=0; if (off==0) link2ParPos=false; else @@ -385,24 +386,36 @@ void BranchObj::setDockPos() { - // Sets childpos and parpos depending on orientation - if (getOrientation()==LinkableMapObj::LeftOfCenter ) - { - childPos=QPointF ( - ornamentsBBox.bottomLeft().x(), - bottomlineY); - parPos=QPointF ( - ornamentsBBox.bottomRight().x(), - bottomlineY); - } else - { - childPos=QPointF ( - ornamentsBBox.bottomRight().x(), - bottomlineY); - parPos=QPointF ( - ornamentsBBox.bottomLeft().x(), - bottomlineY); - } + if (treeItem->getType()==TreeItem::MapCenter) + { + // set childPos to middle of MapCenterObj + childPos.setX( clickBox.topLeft().x() + clickBox.width()/2 ); + childPos.setY( clickBox.topLeft().y() + clickBox.height()/2 ); + parPos=childPos; + for (int i=0; ibranchCount(); ++i) + treeItem->getBranchObjNum(i)->updateLink(); + + } else + { + // Sets childpos and parpos depending on orientation + if (getOrientation()==LinkableMapObj::LeftOfCenter ) + { + childPos=QPointF ( + ornamentsBBox.bottomLeft().x(), + bottomlineY); + parPos=QPointF ( + ornamentsBBox.bottomRight().x(), + bottomlineY); + } else + { + childPos=QPointF ( + ornamentsBBox.bottomRight().x(), + bottomlineY); + parPos=QPointF ( + ornamentsBBox.bottomLeft().x(), + bottomlineY); + } + } } void BranchObj::updateData()