diff -r 325958acb69b -r d5a0ea67c91d linkablemapobj.cpp --- a/linkablemapobj.cpp Mon Oct 10 11:20:25 2005 +0000 +++ b/linkablemapobj.cpp Tue Feb 21 16:18:23 2006 +0000 @@ -94,6 +94,8 @@ hideLinkUnselected=false; + topPad=botPad=leftPad=rightPad=0; + // initialize frame frame = new FrameObj (canvas); @@ -133,6 +135,21 @@ return false; } +int LinkableMapObj::getTopPad() +{ + return topPad; +} + +int LinkableMapObj::getLeftPad() +{ + return leftPad; +} + +int LinkableMapObj::getRightPad() +{ + return rightPad; +} + LinkStyle LinkableMapObj::getDefLinkStyle () { if (!mapEditor) return StyleUndef; @@ -417,7 +434,7 @@ // orientation // childPos // parPos - // offset + // bottomlineY // drawing of the link itself @@ -432,10 +449,10 @@ switch (linkpos) { case LinkMiddle: - offset=bbox.height() /2; + bottomlineY=clickBox.top()+clickBox.height() /2; // draw link to middle (of frame) break; default : - offset=bbox.height()-1; // draw link to bottom of bbox + bottomlineY=clickBox.bottom()-1; // draw link to bottom of bbox break; } @@ -478,12 +495,12 @@ if (orientation==OrientLeftOfCenter ) { - childPos=QPoint (absPos.x(),absPos.y()+offset); - parPos=QPoint (absPos.x()+ bbox.width(), absPos.y() + offset ); + childPos=QPoint (absPos.x(),bottomlineY); + parPos=QPoint (absPos.x()+ bbox.width(), bottomlineY ); } else { - childPos=QPoint (absPos.x()+ bbox.width(), absPos.y() + offset ); - parPos=QPoint (absPos.x(),absPos.y()+offset); + childPos=QPoint (absPos.x()+ bbox.width(), bottomlineY ); + parPos=QPoint (absPos.x(),bottomlineY); } double p1x=parPos.x(); // Link is drawn from P1 to P2 @@ -715,9 +732,9 @@ void LinkableMapObj::setSelBox() { - selbox->setX (bbox.x() ); - selbox->setY (bbox.y() ); - selbox->setSize (bbox.width(), bbox.height() ); + selbox->setX (clickBox.x() ); + selbox->setY (clickBox.y() ); + selbox->setSize (clickBox.width(), clickBox.height() ); } void LinkableMapObj::select() @@ -767,13 +784,9 @@ QString LinkableMapObj::getLinkAttr () { - QString hideAttr; if (hideLinkUnselected) - // Since this is currently the - // only attribut and it is switched off by default - // don't write at all if it is missing - return attribut ("hideLinkUnselected","true"); + return attribut ("hideLink","true"); else - return ""; + return attribut ("hideLink","false"); }