diff -r a40af6315ac6 -r 3a58c9ef4a18 linkablemapobj.cpp --- a/linkablemapobj.cpp Thu Sep 14 11:38:17 2006 +0000 +++ b/linkablemapobj.cpp Thu Sep 14 11:38:18 2006 +0000 @@ -154,10 +154,8 @@ { if (parObj) { - relPos=getRelPos(); - + getRelPos(); parObj->calcBBoxSize(); - parObj->requestReposition(); } } @@ -165,8 +163,9 @@ { relPos=p; if (parObj) - { parObj->calcBBoxSize(); - parObj->requestReposition(); + { + parObj->calcBBoxSize(); + requestReposition(); } } @@ -468,6 +467,31 @@ } } +void LinkableMapObj::setOrientation() +{ + LinkOrient orientOld=orientation; + + if (!parObj) + { + orientation=OrientUndef; + return; + } + + // Set orientation, first look for orientation of parent + if (parObj->getOrientation() != OrientUndef ) + // use the orientation of the parent: + orientation=parObj->getOrientation(); + else + { + // calc orientation depending on position rel to parent + if (absPos.x() < QPoint(parObj->getChildPos() ).x() ) + orientation=OrientLeftOfCenter; + else + orientation=OrientRightOfCenter; + } + if (orientOld!=orientation) requestReposition(); +} + void LinkableMapObj::updateLink() { // needs: @@ -511,21 +535,11 @@ p2y=QPoint( parObj->getParPos() ).y(); } + + + setDockPos(); // Call overloaded method +/* FIXME not needed? LinkOrient orientOld=orientation; - - // Set orientation, first look for orientation of parent - if (parObj->getOrientation() != OrientUndef ) - // use the orientation of the parent: - orientation=parObj->getOrientation(); - else - { - // calc orientation depending on position rel to mapCenter - if (absPos.x() < QPoint(parObj->getChildPos() ).x() ) - orientation=OrientLeftOfCenter; - else - orientation=OrientRightOfCenter; - } - if ((orientation!=orientOld) && (orientOld!= OrientUndef)) { // Orientation just changed. Reorient this subbranch, because move is called @@ -534,10 +548,11 @@ // // Also possible: called in BranchObj::init(), then orientOld==OrientUndef, // no need to reposition now + cout <<"Trying to reorientate... orient="<