diff -r 4b872954721b -r e03b393e4e51 branchobj.cpp --- a/branchobj.cpp Fri Feb 24 11:22:50 2006 +0000 +++ b/branchobj.cpp Wed Mar 01 14:39:04 2006 +0000 @@ -575,21 +575,9 @@ void BranchObj::positionBBox() { - /*// TODO testing (optimization) - QString h=getHeading(); - if (!h.isEmpty()) - cout << "BO::positionBBox("<getBorder()/2; - - bbox.moveTopLeft (QPoint (absPos.x(), absPos.y() - topPad)); - clickBox.moveTopLeft(QPoint (absPos.x()+d, absPos.y()+d )); - setSelBox(); // set the frame @@ -604,8 +592,8 @@ void BranchObj::calcBBoxSize() { QSize heading_r=heading->getSize(); - int heading_w=static_cast (heading_r.width() ); - int heading_h=static_cast (heading_r.height() ); + int heading_w=(int) heading_r.width() ; + int heading_h=(int) heading_r.height() ; QSize sysflags_r=systemFlags->getSize(); int sysflags_h=sysflags_r.height(); int sysflags_w=sysflags_r.width(); @@ -621,7 +609,11 @@ h=max (sysflags_h,stanflags_h); h=max (h,heading_h); - clickBox.setSize (QSize (w,h)); + // Save the dimension of flags and heading + ornamentsBBox.setSize ( QSize(w,h)); + + // clickBox includes Flags and Heading + clickBox.setSize (ornamentsBBox.size() ); // Floatimages QPoint rp; @@ -638,16 +630,25 @@ if (includeImagesVer) { if (rp.y() < 0) - topPad=max (topPad,-rp.y()); - if (rp.y()+foi->height() > h) - botPad=max (botPad,rp.y()+foi->height()-h); + topPad=max (topPad,-rp.y()-h); + if (rp.y()+foi->height() > 0) + botPad=max (botPad,rp.y()+foi->height()); } if (includeImagesHor) { - if (rp.x() < 0) - leftPad=max (leftPad,-rp.x()); - if (rp.x()+foi->width() > w) - rightPad=max (rightPad,rp.x()+foi->width()-w); + if (orientation==OrientRightOfCenter) + { + if (-rp.x()-w > 0) + leftPad=max (leftPad,-rp.x()-w); + if (rp.x()+foi->width() > 0) + rightPad=max (rightPad,rp.x()+foi->width()); + } else + { + if (rp.x()< 0) + leftPad=max (leftPad,-rp.x()); + if (rp.x()+foi->width() > w) + rightPad=max (rightPad,rp.x()+foi->width()-w); + } } } } @@ -663,6 +664,18 @@ bbox.setSize (QSize (w,h)); } +void BranchObj::setDockPos() +{ + if (getOrientation()==OrientLeftOfCenter ) + { + childPos=QPoint (ornamentsBBox.bottomLeft().x(), ornamentsBBox.bottomLeft().y() ); + parPos=QPoint (ornamentsBBox.bottomRight().x(),ornamentsBBox.bottomRight().y() ); + } else + { + childPos=QPoint (ornamentsBBox.bottomRight().x(), ornamentsBBox.bottomRight().y() ); + parPos=QPoint (ornamentsBBox.bottomLeft().x(),ornamentsBBox.bottomLeft().y() ); + } +} LinkableMapObj* BranchObj::findMapObj(QPoint p, LinkableMapObj* excludeLMO) { // Search branches @@ -871,6 +884,7 @@ return xlink.count(); } + BranchObj* BranchObj::XLinkTargetAt (int i) { if (xlink.at(i)) @@ -1223,18 +1237,16 @@ void BranchObj::alignRelativeTo (QPoint ref) { int th = bboxTotal.height(); -/* TODO testing - if (!getHeading().isEmpty()) - cout << "BO::alignRelTo "<