branchobj.cpp
branchrelease-1-12-maintained
changeset 41 6f28020b33d1
parent 40 394b2f297e1d
child 42 b2c0fe7cfdef
     1.1 --- a/branchobj.cpp	Thu Jul 17 11:11:55 2008 +0000
     1.2 +++ b/branchobj.cpp	Thu Jul 17 12:55:24 2008 +0000
     1.3 @@ -1310,7 +1310,7 @@
     1.4  	}	
     1.5  }
     1.6  
     1.7 -void BranchObj::alignRelativeTo (QPointF ref)
     1.8 +void BranchObj::alignRelativeTo (QPointF ref,bool alignSelf)
     1.9  {
    1.10  	qreal th = bboxTotal.height();	
    1.11  // TODO testing
    1.12 @@ -1359,18 +1359,19 @@
    1.13  		{
    1.14  			LinkableMapObj::Orientation o;
    1.15  			o=parObj->getOrientation();
    1.16 -			switch (orientation) 
    1.17 -			{
    1.18 -				case LinkableMapObj::LeftOfCenter:
    1.19 -					move (ref.x() - bbox.width(), ref.y() + (th-bbox.height())/2 );
    1.20 -				break;
    1.21 -				case LinkableMapObj::RightOfCenter:	
    1.22 -					move (ref.x() , ref.y() + (th-bbox.height())/2  );
    1.23 -				break;
    1.24 -				default:
    1.25 -					qWarning ("LMO::alignRelativeTo: oops, no orientation given...");
    1.26 -				break;
    1.27 -			}	
    1.28 +			if (alignSelf)
    1.29 +				switch (orientation) 
    1.30 +				{
    1.31 +					case LinkableMapObj::LeftOfCenter:
    1.32 +						move (ref.x() - bbox.width(), ref.y() + (th-bbox.height())/2 );
    1.33 +					break;
    1.34 +					case LinkableMapObj::RightOfCenter:	
    1.35 +						move (ref.x() , ref.y() + (th-bbox.height())/2  );
    1.36 +					break;
    1.37 +					default:
    1.38 +						qWarning ("LMO::alignRelativeTo: oops, no orientation given...");
    1.39 +					break;
    1.40 +				}	
    1.41  		}
    1.42      }		
    1.43  
    1.44 @@ -1393,7 +1394,7 @@
    1.45      {	
    1.46  		if (!branch.at(i)->isHidden())
    1.47  		{
    1.48 -			branch.at(i)->alignRelativeTo (ref2);
    1.49 +			branch.at(i)->alignRelativeTo (ref2,true);
    1.50  			ref2.setY(ref2.y() + branch.at(i)->getBBoxSizeWithChilds().height() );
    1.51  		}
    1.52      }