1.7.18
authorinsilmaril
Wed, 31 May 2006 12:27:38 +0000
changeset 33394cd6a451593
parent 332 89e7476b0007
child 334 df4fdaa07527
1.7.18
branchobj.cpp
     1.1 --- a/branchobj.cpp	Wed May 31 12:27:38 2006 +0000
     1.2 +++ b/branchobj.cpp	Wed May 31 12:27:38 2006 +0000
     1.3 @@ -529,6 +529,13 @@
     1.4  	itLast=it;
     1.5  }
     1.6  
     1.7 +void BranchObj::positionContents()
     1.8 +{
     1.9 +	FloatImageObj *fio;
    1.10 +    for (fio=floatimage.first(); fio; fio=floatimage.next() )
    1.11 +		fio->reposition();
    1.12 +	OrnamentedObj::positionContents();
    1.13 +}
    1.14  
    1.15  void BranchObj::move (double x, double y)
    1.16  {
    1.17 @@ -547,10 +554,10 @@
    1.18  void BranchObj::moveBy (double x, double y)
    1.19  {
    1.20  	OrnamentedObj::moveBy (x,y);
    1.21 -    positionBBox();
    1.22      BranchObj* b;
    1.23      for (b=branch.first(); b;b=branch.next() ) 
    1.24  		b->moveBy (x,y);
    1.25 +    positionBBox();
    1.26  }
    1.27  	
    1.28  void BranchObj::moveBy (QPoint p)
    1.29 @@ -1228,16 +1235,13 @@
    1.30  
    1.31  	// If I am the mapcenter or a mainbranch, reposition heading
    1.32  	if (depth<2)
    1.33 -	{	//FIXME optimize this   move for MCO needed to initially position text in box...
    1.34 +	{	//FIXME ugly! optimize this   move for MCO needed to initially position text in box...
    1.35  		if (depth==1)
    1.36 -		{
    1.37 -			move (absPos.x(),absPos.y());
    1.38  			// Calc angle to mapCenter if I am a mainbranch
    1.39  			// needed for reordering the mainbranches clockwise 
    1.40  			// around mapcenter 
    1.41  			angle=getAngle (QPoint ((int)(x() - parObj->getChildPos().x() ), 
    1.42  									(int)(y() - parObj->getChildPos().y() ) ) );
    1.43 -		} 
    1.44  	} 
    1.45  	else
    1.46      {
    1.47 @@ -1298,15 +1302,13 @@
    1.48  		// changes its height,
    1.49  		// all upper LMOs have to change, too.
    1.50  		calcBBoxSizeWithChilds();
    1.51 +		updateLink();	// This update is needed if the canvas is resized 
    1.52 +						// due to excessive moving of a FIO
    1.53 +
    1.54  	    alignRelativeTo ( QPoint (absPos.x(),
    1.55  			absPos.y()-(bboxTotal.height()-bbox.height())/2) );
    1.56  		branch.sort();	
    1.57 -		updateLink();	// This update is needed if the canvas is resized 
    1.58 -						// due to excessive moving of a FIO
    1.59 -
    1.60 -		// After load, the floats might be at wrong position, force
    1.61 -		// them to move, too
    1.62 -		//move (absPos);	// FIXME really still needed to position floats?
    1.63 +		positionBBox();	// Reposition bbox and contents
    1.64  	} else
    1.65  	{
    1.66  		// This is only important for moving branches: