[dasher] Fix another offset bug where textbox could get out of sync



commit 62d555cee5f74c7b8db14fbae814eb88b2b823fc
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date:   Fri Aug 27 16:51:42 2010 +0100

    Fix another offset bug where textbox could get out of sync
    
    (following multiple alphabet changes and steering outside the root!)

 Src/DasherCore/DasherModel.cpp |    4 ++++
 Src/DasherCore/DasherModel.h   |    4 +---
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/Src/DasherCore/DasherModel.cpp b/Src/DasherCore/DasherModel.cpp
index cb26c10..89ef4bf 100644
--- a/Src/DasherCore/DasherModel.cpp
+++ b/Src/DasherCore/DasherModel.cpp
@@ -267,6 +267,10 @@ void CDasherModel::SetOffset(int iOffset, CAlphabetManager *pMgr, CDasherView *p
   m_pDasherInterface->ScheduleRedraw();
 }
 
+int CDasherModel::GetOffset() {
+  return m_pLastOutput ? m_pLastOutput->offset()+1 : m_Root ? m_Root->offset()+1 : 0;
+};
+
 void CDasherModel::Get_new_root_coords(dasherint X, dasherint Y, dasherint &r1, dasherint &r2, unsigned long iTime) {
   DASHER_ASSERT(m_Root != NULL);
   if(m_iStartTime == 0)
diff --git a/Src/DasherCore/DasherModel.h b/Src/DasherCore/DasherModel.h
index 4e20685..3752d58 100644
--- a/Src/DasherCore/DasherModel.h
+++ b/Src/DasherCore/DasherModel.h
@@ -193,9 +193,7 @@ class Dasher::CDasherModel:public Dasher::CFrameRate, private NoClones
   /// - measured in (unicode) characters, _not_ octets.
   ///
 
-  int GetOffset() {
-    return m_pLastOutput ? m_pLastOutput->offset()+1 : 0;
-  };
+  int GetOffset();
 
   /// Create the children of a Dasher node
   void ExpandNode(CDasherNode * pNode); 



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