1.7.10 includeImagesHorizontally implemented
authorinsilmaril
Wed, 01 Mar 2006 14:39:04 +0000
changeset 225d5c70aaca22d
parent 224 bbb4eeefcc94
child 226 5e684bfe5bb1
1.7.10 includeImagesHorizontally implemented
linkablemapobj.cpp
     1.1 --- a/linkablemapobj.cpp	Wed Mar 01 14:39:04 2006 +0000
     1.2 +++ b/linkablemapobj.cpp	Wed Mar 01 14:39:04 2006 +0000
     1.3 @@ -149,18 +149,11 @@
     1.4  
     1.5  void LinkableMapObj::setRelPos()
     1.6  {
     1.7 -	if (useOrientation)
     1.8 -	{
     1.9 -		if (parObj->getOrientation()==OrientLeftOfCenter)
    1.10 -			relPos.setX ( parObj->x() +parObj->width() - bbox.width() -absPos.x());
    1.11 -		else	
    1.12 -			relPos.setX (absPos.x() - parObj->x() );
    1.13 -	}
    1.14 -	else
    1.15 -		relPos.setX (absPos.x() - parObj->x() );
    1.16 -	relPos.setY (absPos.y() - parObj->y() );
    1.17  	if (parObj)
    1.18  	{	
    1.19 +		relPos.setX (absPos.x() - parObj->getChildPos().x() );
    1.20 +		relPos.setY (absPos.y() - parObj->getChildPos().y() );
    1.21 +
    1.22  		parObj->calcBBoxSize();
    1.23  		parObj->requestReposition();
    1.24  	}	
    1.25 @@ -472,12 +465,11 @@
    1.26      // 
    1.27      // sets:
    1.28      //	orientation
    1.29 -    //	childPos
    1.30 -    //	parPos
    1.31 +    //	childPos	(by calling setDockPos())
    1.32 +    //	parPos		(by calling setDockPos())
    1.33  	//  bottomlineY
    1.34      //	drawing of the link itself
    1.35  
    1.36 -
    1.37  	// updateLink is called from move, but called from constructor we don't
    1.38  	// have parents yet...
    1.39  	if (style==StyleUndef) return;	
    1.40 @@ -489,10 +481,10 @@
    1.41  	switch (linkpos)
    1.42  	{
    1.43  		case LinkMiddle:
    1.44 -			bottomlineY=clickBox.top()+clickBox.height() /2;	// draw link to middle (of frame)
    1.45 +			bottomlineY=bbox.top()+bbox.height() /2;	// draw link to middle (of frame)
    1.46  			break;
    1.47  		default :
    1.48 -			bottomlineY=clickBox.bottom()-1;	// draw link to bottom of bbox
    1.49 +			bottomlineY=bbox.bottom()-1;	// draw link to bottom of box
    1.50  			break;
    1.51  	}
    1.52  	
    1.53 @@ -533,15 +525,7 @@
    1.54  		reposition();
    1.55  	}
    1.56  	
    1.57 -    if (orientation==OrientLeftOfCenter )
    1.58 -    {
    1.59 -		childPos=QPoint (absPos.x(),bottomlineY);
    1.60 -		parPos=QPoint (absPos.x()+ bbox.width(),  bottomlineY );
    1.61 -    } else
    1.62 -    {
    1.63 -		childPos=QPoint (absPos.x()+ bbox.width(), bottomlineY ); 
    1.64 -		parPos=QPoint (absPos.x(),bottomlineY);
    1.65 -    }
    1.66 +	setDockPos();
    1.67  
    1.68  	double p1x=parPos.x();	// Link is drawn from P1 to P2
    1.69  	double p1y=parPos.y();
    1.70 @@ -661,6 +645,11 @@
    1.71  	return lmo;
    1.72  }
    1.73  
    1.74 +void LinkableMapObj::setDockPos()
    1.75 +{
    1.76 +	cout <<"LMO::setDockPos()\n";
    1.77 +}
    1.78 +
    1.79  QPoint LinkableMapObj::getChildPos()
    1.80  {
    1.81      return childPos;
    1.82 @@ -673,11 +662,16 @@
    1.83  
    1.84  QPoint LinkableMapObj::getRelPos()
    1.85  {
    1.86 +	return relPos;
    1.87 +/* FIXME not needed? relPos was moved in 1.7.10 from
    1.88 +   floatobj to linkablemapobj. Before we had:
    1.89 +	
    1.90  	if (!parObj) return QPoint (0,0);
    1.91      return QPoint(
    1.92  		absPos.x() - parObj->x(),
    1.93  		absPos.y() - parObj->y()
    1.94  	);
    1.95 +*/	
    1.96  }
    1.97  
    1.98