branchobj.cpp
changeset 166 325958acb69b
parent 164 d442a66e9121
child 169 aa48c7b52549
     1.1 --- a/branchobj.cpp	Thu Sep 22 12:56:05 2005 +0000
     1.2 +++ b/branchobj.cpp	Mon Oct 10 11:20:25 2005 +0000
     1.3 @@ -569,18 +569,17 @@
     1.4  
     1.5  void BranchObj::positionBBox()
     1.6  {
     1.7 -	// TODO testing (optimization)
     1.8 -	/*
     1.9 +	/*// TODO testing (optimization)
    1.10  	QString h=getHeading();
    1.11  	if (!h.isEmpty())
    1.12  		cout << "BO::positionBBox("<<h<<")\n";
    1.13  	else	
    1.14  		cout << "BO::positionBBox (noHeading)\n";
    1.15 -	*/	
    1.16 +*/		
    1.17  
    1.18 -    heading->positionBBox();
    1.19 -	systemFlags->positionBBox();
    1.20 -	standardFlags->positionBBox();
    1.21 +	// Position contents by moving OO
    1.22 +	OrnamentedObj::move (absPos.x(),absPos.y());
    1.23 + 
    1.24  	// It seems that setting x,y also affects width,height
    1.25  	int w_old=bbox.width();
    1.26  	int h_old=bbox.height();
    1.27 @@ -654,6 +653,11 @@
    1.28  
    1.29  void BranchObj::setHeading(QString s)
    1.30  {
    1.31 +/* FIXME testing only
    1.32 +	cout << "BO::setHeading ("<<s<<")\n";
    1.33 +	cout << "   bo.pos="<<absPos<<endl;
    1.34 +	cout << "   ho.pos="<<heading->getPos()<<endl;
    1.35 +*/	
    1.36      heading->setText(s);	// set new heading
    1.37  	calcBBoxSize();			// recalculate bbox
    1.38      positionBBox();			// rearrange contents
    1.39 @@ -779,7 +783,7 @@
    1.40  	// Save FloatImages
    1.41  	FloatImageObj *fio;
    1.42  	for (fio=floatimage.first(); fio; fio=floatimage.next() )
    1.43 -		s+=fio->saveToDir (tmpdir,prefix);
    1.44 +		s+=fio->saveToDir (tmpdir,prefix,offset);
    1.45  
    1.46  	// Save XLinks
    1.47  	XLinkObj *xlo;
    1.48 @@ -1136,10 +1140,10 @@
    1.49  
    1.50  	// If I am the mapcenter or a mainbranch, reposition heading
    1.51  	if (depth<2)
    1.52 -	{
    1.53 -		move (absPos.x(),absPos.y());
    1.54 +	{	//FIXME optimize this   move for MCO needed to initially position text in box...
    1.55  		if (depth==1)
    1.56  		{
    1.57 +			move (absPos.x(),absPos.y());
    1.58  			// Calc angle to mapCenter if I am a mainbranch
    1.59  			// needed for reordering the mainbranches clockwise 
    1.60  			// around mapcenter