ornamentedobj.cpp
changeset 227 38ad83f1d4ce
parent 218 160459d924a1
child 236 22a885118d50
     1.1 --- a/ornamentedobj.cpp	Wed Mar 01 14:39:04 2006 +0000
     1.2 +++ b/ornamentedobj.cpp	Wed Mar 01 14:39:05 2006 +0000
     1.3 @@ -65,6 +65,8 @@
     1.4  	systemFlags->copy (other->systemFlags);
     1.5  	standardFlags->copy (other->standardFlags);
     1.6  
     1.7 +	ornamentsBBox=other->ornamentsBBox;
     1.8 +
     1.9  }
    1.10  
    1.11  QString OrnamentedObj::getHeading()
    1.12 @@ -91,15 +93,23 @@
    1.13  	double d=frame->getBorder()/2;
    1.14  	double x=absPos.x();
    1.15  	double y=absPos.y();
    1.16 -	systemFlags-> move (x + d, y + d );
    1.17 +
    1.18 +	double ox,oy;	// Offset due to padding
    1.19 +
    1.20 +	ox=leftPad + d;
    1.21 +	oy=topPad + d;
    1.22 +	
    1.23 +	systemFlags-> move (ox +x , oy + y );
    1.24  
    1.25  	// vertical align heading to bottom
    1.26 -	int h=max (systemFlags->getBBox().height(), standardFlags->getBBox().height());
    1.27 -	h=max (h,heading->getHeight());
    1.28 -    heading->move (x + d + systemFlags->getBBox().width(),
    1.29 -					y + d  + h - heading->getHeight() 
    1.30 +    heading->move (ox + x + systemFlags->getBBox().width(),
    1.31 +				   oy + y + ornamentsBBox.height() - heading->getHeight() 
    1.32  					);
    1.33 -	standardFlags->move (x + heading->getWidth() + systemFlags->getBBox().width() + d , y + d  );
    1.34 +	standardFlags->move (ox +x + heading->getWidth() + systemFlags->getBBox().width() , oy + y );
    1.35 +
    1.36 +	ornamentsBBox.moveTopLeft ( QPoint (ox+x, oy+y));
    1.37 +	clickBox.moveTopLeft (QPoint (ox + x, oy + y));
    1.38 +
    1.39  }
    1.40  
    1.41  void OrnamentedObj::move (double x, double y)