Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laseradjustthread.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laseradjustthread.cpp	(revision 4171)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laseradjustthread.cpp	(revision 4172)
@@ -162,34 +162,34 @@
     // Check if this spot is compatible with the spot of the
 		// upper left LED
-    if ( pActualSpot->contains( LED1_X, LED1_Y ) )
-		{
-			dX1 = pActualSpot->getX() + (CAMERA_X - LED1_X);	
+    if ( pActualSpot->contains2( LED1_X, LED1_Y ) )
+		{
+			dX1 = pActualSpot->getX() + (CAMERA_X - LED1_X);
 			dY1 = pActualSpot->getY() + (CAMERA_Y - LED1_Y);
 			dX += dX1; dY += dY1;
       iNumLEDs++;
-		}	
+		}
     // Check if this spot is compatible with the spot of the
 		// upper right LED
-    else if ( pActualSpot->contains( LED2_X, LED2_Y ) )
-		{
-			dX2 = pActualSpot->getX() + (CAMERA_X - LED2_X);	
+    else if ( pActualSpot->contains2( LED2_X, LED2_Y ) )
+		{
+			dX2 = pActualSpot->getX() + (CAMERA_X - LED2_X);
 			dY2 = pActualSpot->getY() + (CAMERA_Y - LED2_Y);
 			dX += dX2; dY += dY2;
       iNumLEDs++;
-		}	
+		}
     // Check if this spot is compatible with the spot of the
 		// lower left LED
-    else if ( pActualSpot->contains( LED3_X, LED3_Y ) )
-		{
-			dX3 = pActualSpot->getX() + (CAMERA_X - LED3_X);	
+    else if ( pActualSpot->contains2( LED3_X, LED3_Y ) )
+		{
+			dX3 = pActualSpot->getX() + (CAMERA_X - LED3_X);
 			dY3 = pActualSpot->getY() + (CAMERA_Y - LED3_Y);
 			dX += dX3; dY += dY3;
       iNumLEDs++;
-		}	
+		}
     // Check if this spot is compatible with the spot of the
 		// lower right LED
-    else if ( pActualSpot->contains( LED4_X, LED4_Y ) )
-		{
-			dX4 = pActualSpot->getX() + (CAMERA_X - LED4_X);	
+    else if ( pActualSpot->contains2( LED4_X, LED4_Y ) )
+		{
+			dX4 = pActualSpot->getX() + (CAMERA_X - LED4_X);
 			dY4 = pActualSpot->getY() + (CAMERA_Y - LED4_Y);
 			dX += dX4; dY += dY4;
@@ -201,6 +201,6 @@
   if( iNumLEDs != 0)
 	{
-		m_iCenterX = (int) rint(dX / iNumLEDs);	
-		m_iCenterY = (int) rint(dY / iNumLEDs);	
+		m_iCenterX = (int) rint(dX / iNumLEDs);
+		m_iCenterY = (int) rint(dY / iNumLEDs);
 	}
 //  qDebug("Center at: %d %d -- with %d LEDs",m_iCenterX, m_iCenterY, iNumLEDs );
@@ -219,10 +219,10 @@
   m_iSpotX -= iDx;
   m_iSpotY -= iDy;
-//	qDebug("Spot at x,y: %4d %4d", m_iSpotX, m_iSpotY );	
+//	qDebug("Spot at x,y: %4d %4d", m_iSpotX, m_iSpotY );
 
 	// Now we calculate the distance of the real spot to the stored reference position
 	p_dX = (double) (iRefX - m_iSpotX);
 	p_dY = (double) (iRefY - m_iSpotY);
-//	qDebug("Dx Dy: %4.0f %4.0f", dX, dY );	
+//	qDebug("Dx Dy: %4.0f %4.0f", dX, dY );
 }
 
@@ -235,5 +235,5 @@
 	double dAlpha1 = atan( m_pPanel->getSlopeX() );
 	double dAlpha2 = atan( m_pPanel->getSlopeY() );
-//	qDebug("alpha1, alpha2: %7.2f %7.2f", dAlpha1 * 180.0 / 3.1415, dAlpha2 * 180.0 / 3.1415 );	
+//	qDebug("alpha1, alpha2: %7.2f %7.2f", dAlpha1 * 180.0 / 3.1415, dAlpha2 * 180.0 / 3.1415 );
 	double dSinA1 = sin( dAlpha1 );
 	double dSinA2 = sin( dAlpha2 );
@@ -244,5 +244,5 @@
 	dFacX /= ( dCosA1 - dSinA1 * dCosA2 / dSinA2 );
 	double dFacY = (dY - dFacX * dSinA1) / dSinA2;
-//	qDebug("Factor x,y: %8.2f %8.2f", dFacX, dFacY );	
+//	qDebug("Factor x,y: %8.2f %8.2f", dFacX, dFacY );
 
 	p_iX = (int) ( dFacX * m_pPanel->getConversionX() );
@@ -253,5 +253,5 @@
 	p_iY = (p_iY >> 1) << 1;
 
-	qDebug("Steps till reference: %4d %4d", p_iX, p_iY );	
+	qDebug("Steps till reference: %4d %4d", p_iX, p_iY );
   QCString qsMsg;
 	qsMsg.sprintf( "%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %5d %5d",
@@ -261,5 +261,5 @@
 				  			 m_pPanel->getLaserX(), m_pPanel->getLaserY(),
 								 (int) rint(dX), (int) rint(dY),
-								 p_iX, p_iY );	
+								 p_iX, p_iY );
 	QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
 }
@@ -272,8 +272,8 @@
 
 	m_qlSpotList.clear();
-	int top = LED2_Y - 10;
-	int bottom = LED3_Y + 10;
-	int left = LED1_X - 10;
-	int right = LED4_X + 10;
+	int top = LED2_Y - 20;
+	int bottom = LED3_Y + 20;
+	int left = LED1_X - 20;
+	int right = LED4_X + 20;
 
   for (int i=top; i <bottom; i++)
@@ -306,5 +306,5 @@
 		}
 	}
-  calcCenter();
+	calcCenter();
 	if( m_qlSpots.count() == 1)
 	{
