# HG changeset patch
# User insilmaril
# Date 1141223944 0
# Node ID d5c70aaca22d6521c35f9ea73899b244037e1ccd
# Parent  bbb4eeefcc94841e9aae343722ccf76728cb8964
1.7.10  includeImagesHorizontally implemented

diff -r bbb4eeefcc94 -r d5c70aaca22d linkablemapobj.cpp
--- a/linkablemapobj.cpp	Wed Mar 01 14:39:04 2006 +0000
+++ b/linkablemapobj.cpp	Wed Mar 01 14:39:04 2006 +0000
@@ -149,18 +149,11 @@
 
 void LinkableMapObj::setRelPos()
 {
-	if (useOrientation)
-	{
-		if (parObj->getOrientation()==OrientLeftOfCenter)
-			relPos.setX ( parObj->x() +parObj->width() - bbox.width() -absPos.x());
-		else	
-			relPos.setX (absPos.x() - parObj->x() );
-	}
-	else
-		relPos.setX (absPos.x() - parObj->x() );
-	relPos.setY (absPos.y() - parObj->y() );
 	if (parObj)
 	{	
+		relPos.setX (absPos.x() - parObj->getChildPos().x() );
+		relPos.setY (absPos.y() - parObj->getChildPos().y() );
+
 		parObj->calcBBoxSize();
 		parObj->requestReposition();
 	}	
@@ -472,12 +465,11 @@
     // 
     // sets:
     //	orientation
-    //	childPos
-    //	parPos
+    //	childPos	(by calling setDockPos())
+    //	parPos		(by calling setDockPos())
 	//  bottomlineY
     //	drawing of the link itself
 
-
 	// updateLink is called from move, but called from constructor we don't
 	// have parents yet...
 	if (style==StyleUndef) return;	
@@ -489,10 +481,10 @@
 	switch (linkpos)
 	{
 		case LinkMiddle:
-			bottomlineY=clickBox.top()+clickBox.height() /2;	// draw link to middle (of frame)
+			bottomlineY=bbox.top()+bbox.height() /2;	// draw link to middle (of frame)
 			break;
 		default :
-			bottomlineY=clickBox.bottom()-1;	// draw link to bottom of bbox
+			bottomlineY=bbox.bottom()-1;	// draw link to bottom of box
 			break;
 	}
 	
@@ -533,15 +525,7 @@
 		reposition();
 	}
 	
-    if (orientation==OrientLeftOfCenter )
-    {
-		childPos=QPoint (absPos.x(),bottomlineY);
-		parPos=QPoint (absPos.x()+ bbox.width(),  bottomlineY );
-    } else
-    {
-		childPos=QPoint (absPos.x()+ bbox.width(), bottomlineY ); 
-		parPos=QPoint (absPos.x(),bottomlineY);
-    }
+	setDockPos();
 
 	double p1x=parPos.x();	// Link is drawn from P1 to P2
 	double p1y=parPos.y();
@@ -661,6 +645,11 @@
 	return lmo;
 }
 
+void LinkableMapObj::setDockPos()
+{
+	cout <<"LMO::setDockPos()\n";
+}
+
 QPoint LinkableMapObj::getChildPos()
 {
     return childPos;
@@ -673,11 +662,16 @@
 
 QPoint LinkableMapObj::getRelPos()
 {
+	return relPos;
+/* FIXME not needed? relPos was moved in 1.7.10 from
+   floatobj to linkablemapobj. Before we had:
+	
 	if (!parObj) return QPoint (0,0);
     return QPoint(
 		absPos.x() - parObj->x(),
 		absPos.y() - parObj->y()
 	);
+*/	
 }