[dasher] Remove b1D/bNonLinearity. (24-Jul-2009)



commit 353058269ed32542c8e21bb411541aac86e76540
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date:   Mon Aug 10 10:10:37 2009 +0200

    Remove b1D/bNonLinearity. (24-Jul-2009)

 ChangeLog                           |    1 +
 Src/DasherCore/DasherView.cpp       |    6 +++---
 Src/DasherCore/DasherView.h         |    2 +-
 Src/DasherCore/DasherViewSquare.cpp |   28 +++++++++-------------------
 Src/DasherCore/DasherViewSquare.h   |    2 +-
 5 files changed, 15 insertions(+), 24 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 34844aa..1dffbe6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
 	* Remove unused GetRenderCount methods
 	* Cleanup Alphabet{,Map} e.g. g/c KeyIsPrefix.
 	* Alphabet{,Map}: Optimise single byte UTF8 case.
+	* DasherView{,Square}: Remove b1D/bNonLinearity.
 
 2009-08-08  Alan Lawrence <acl33 inf phy cam ac uk>
 
diff --git a/Src/DasherCore/DasherView.cpp b/Src/DasherCore/DasherView.cpp
index d111c9f..35ccf70 100644
--- a/Src/DasherCore/DasherView.cpp
+++ b/Src/DasherCore/DasherView.cpp
@@ -304,8 +304,8 @@ void CDasherView::DasherDrawText(myint iAnchorX1, myint iAnchorY1, myint iAnchor
     myint iDasherNewRight;
     myint iDasherNewBottom;
     
-    Screen2Dasher(newleft2, newtop2, iDasherNewLeft, iDasherNewTop,false,true);
-    Screen2Dasher(newright2, newbottom2, iDasherNewRight, iDasherNewBottom,false,true);
+    Screen2Dasher(newleft2, newtop2, iDasherNewLeft, iDasherNewTop);
+    Screen2Dasher(newright2, newbottom2, iDasherNewRight, iDasherNewBottom);
     
     mostleft = std::min(iDasherNewRight, iDasherNewLeft);
   }
@@ -357,7 +357,7 @@ int CDasherView::GetCoordinates(myint &iDasherX, myint &iDasherY) {
 
   switch(iType) {
   case 0:
-    Screen2Dasher(mousex, mousey, iDasherX, iDasherY, false, true );
+    Screen2Dasher(mousex, mousey, iDasherX, iDasherY);
     break;
   case 1:
     iDasherX = mousex;
diff --git a/Src/DasherCore/DasherView.h b/Src/DasherCore/DasherView.h
index fabf794..8ed616c 100644
--- a/Src/DasherCore/DasherView.h
+++ b/Src/DasherCore/DasherView.h
@@ -91,7 +91,7 @@ public:
   /// Convert a screen co-ordinate to Dasher co-ordinates
   ///
 
-  virtual void Screen2Dasher(screenint iInputX, screenint iInputY, myint & iDasherX, myint & iDasherY,bool b1D, bool bNonlinearity) = 0;
+  virtual void Screen2Dasher(screenint iInputX, screenint iInputY, myint & iDasherX, myint & iDasherY) = 0;
 
   ///
   /// Convert Dasher co-ordinates to screen co-ordinates
diff --git a/Src/DasherCore/DasherViewSquare.cpp b/Src/DasherCore/DasherViewSquare.cpp
index 0fe9f06..cfb75a4 100644
--- a/Src/DasherCore/DasherViewSquare.cpp
+++ b/Src/DasherCore/DasherViewSquare.cpp
@@ -705,7 +705,7 @@ int CDasherViewSquare::RenderNodeFatherFast(const int parent_color, myint y1, my
 /// just the inverse of the mapping used to calculate the screen
 /// positions of boxes etc.
 
-void CDasherViewSquare::Screen2Dasher(screenint iInputX, screenint iInputY, myint &iDasherX, myint &iDasherY, bool b1D, bool bNonlinearity) {
+void CDasherViewSquare::Screen2Dasher(screenint iInputX, screenint iInputY, myint &iDasherX, myint &iDasherY) {
 
   // Things we're likely to need:
 
@@ -715,14 +715,6 @@ void CDasherViewSquare::Screen2Dasher(screenint iInputX, screenint iInputY, myin
   screenint iScreenWidth = Screen()->GetWidth();
   screenint iScreenHeight = Screen()->GetHeight();
 
-  // TODO: Is this used any more?
-  if( b1D ) { // Special case for 1D mode...
-    DASHER_ASSERT(false);
-    //    iDasherX = iInputX * iDasherWidth / iScreenWidth;
-    // iDasherY = iInputY * iDasherHeight / iScreenHeight;
-    //return;
-  }
-
   int eOrientation(GetLongParameter(LP_REAL_ORIENTATION));
 
   myint iScaleFactorX;
@@ -751,10 +743,8 @@ void CDasherViewSquare::Screen2Dasher(screenint iInputX, screenint iInputY, myin
 
 #ifndef WITH_MAEMO
   // FIXME - disabled to avoid floating point
-  if( bNonlinearity ) {
     iDasherX = myint(ixmap(iDasherX / static_cast < double >(GetLongParameter(LP_MAX_Y))) * (myint)GetLongParameter(LP_MAX_Y));
     iDasherY = m_ymap.unmap(iDasherY);
-  }
 #endif
   
 }
@@ -919,20 +909,20 @@ void CDasherViewSquare::VisibleRegion( myint &iDasherMinX, myint &iDasherMinY, m
     
     switch( eOrientation ) {
     case Dasher::Opts::LeftToRight:
-      Screen2Dasher(Screen()->GetWidth(),0,m_iDasherMinX,m_iDasherMinY,false,true);
-      Screen2Dasher(0,Screen()->GetHeight(),m_iDasherMaxX,m_iDasherMaxY,false,true);
+      Screen2Dasher(Screen()->GetWidth(),0,m_iDasherMinX,m_iDasherMinY);
+      Screen2Dasher(0,Screen()->GetHeight(),m_iDasherMaxX,m_iDasherMaxY);
       break;
     case Dasher::Opts::RightToLeft:
-      Screen2Dasher(0,0,m_iDasherMinX,m_iDasherMinY,false,true);
-      Screen2Dasher(Screen()->GetWidth(),Screen()->GetHeight(),m_iDasherMaxX,m_iDasherMaxY,false,true);
+      Screen2Dasher(0,0,m_iDasherMinX,m_iDasherMinY);
+      Screen2Dasher(Screen()->GetWidth(),Screen()->GetHeight(),m_iDasherMaxX,m_iDasherMaxY);
       break;
     case Dasher::Opts::TopToBottom:
-      Screen2Dasher(0,Screen()->GetHeight(),m_iDasherMinX,m_iDasherMinY,false,true);
-      Screen2Dasher(Screen()->GetWidth(),0,m_iDasherMaxX,m_iDasherMaxY,false,true);
+      Screen2Dasher(0,Screen()->GetHeight(),m_iDasherMinX,m_iDasherMinY);
+      Screen2Dasher(Screen()->GetWidth(),0,m_iDasherMaxX,m_iDasherMaxY);
       break;
     case Dasher::Opts::BottomToTop:
-      Screen2Dasher(0,0,m_iDasherMinX,m_iDasherMinY,false,true);
-      Screen2Dasher(Screen()->GetWidth(),Screen()->GetHeight(),m_iDasherMaxX,m_iDasherMaxY,false,true);
+      Screen2Dasher(0,0,m_iDasherMinX,m_iDasherMinY);
+      Screen2Dasher(Screen()->GetWidth(),Screen()->GetHeight(),m_iDasherMaxX,m_iDasherMaxY);
       break;
     }
     
diff --git a/Src/DasherCore/DasherViewSquare.h b/Src/DasherCore/DasherViewSquare.h
index a8a8ad9..f7366d1 100644
--- a/Src/DasherCore/DasherViewSquare.h
+++ b/Src/DasherCore/DasherViewSquare.h
@@ -71,7 +71,7 @@ public:
   /// 
   /// Convert a screen co-ordinate to Dasher co-ordinates
   ///
-  void Screen2Dasher(screenint iInputX, screenint iInputY, myint & iDasherX, myint & iDasherY,bool b1D, bool bNonlinearity);
+  void Screen2Dasher(screenint iInputX, screenint iInputY, myint & iDasherX, myint & iDasherY);
 
   ///
   /// Convert Dasher co-ordinates to screen co-ordinates



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]