diff -r 375be2baa976 -r 160459d924a1 linkablemapobj.cpp --- a/linkablemapobj.cpp Tue Feb 21 16:18:23 2006 +0000 +++ b/linkablemapobj.cpp Thu Feb 23 08:37:39 2006 +0000 @@ -100,6 +100,10 @@ frame = new FrameObj (canvas); repositionRequest=false; + + // Rel Positions + relPos=QPoint(0,0); + useOrientation=true; } void LinkableMapObj::copy (LinkableMapObj* other) @@ -108,6 +112,9 @@ bboxTotal=other->bboxTotal; setLinkStyle(other->style); setLinkColor (other->linkcolor); + relPos=other->relPos; + useOrientation=other->useOrientation; + } void LinkableMapObj::setChildObj(LinkableMapObj* o) @@ -135,6 +142,39 @@ return false; } +void LinkableMapObj::setUseRelPos (const bool &b) +{ + useRelPos=b; +} + +void LinkableMapObj::setRelPos() +{ + if (useOrientation) + { + if (parObj->getOrientation()==OrientLeftOfCenter) + relPos.setX ( parObj->x() +parObj->width() - bbox.width() -absPos.x()); + else + relPos.setX (absPos.x() - parObj->x() ); + } + else + relPos.setX (absPos.x() - parObj->x() ); + relPos.setY (absPos.y() - parObj->y() ); + if (parObj) + { + parObj->calcBBoxSize(); + parObj->requestReposition(); + } +} + +void LinkableMapObj::setRelPos(const QPoint &p) +{ + relPos=p; + if (parObj) + { parObj->calcBBoxSize(); + parObj->requestReposition(); + } +} + int LinkableMapObj::getTopPad() { return topPad; @@ -640,6 +680,16 @@ ); } + +void LinkableMapObj::setUseOrientation (const bool &b) +{ + if (useOrientation!=b) + { + useOrientation=b; + requestReposition(); + } +} + LinkOrient LinkableMapObj::getOrientation() { return orientation;