OSDN Git Service

PATCH: [ 721939 ] Wider horiz scroll + more space after last char
authorKimmo Varis <kimmov@gmail.com>
Wed, 23 Apr 2003 13:16:48 +0000 (13:16 +0000)
committerKimmo Varis <kimmov@gmail.com>
Wed, 23 Apr 2003 13:16:48 +0000 (13:16 +0000)
Src/editlib/ccrystaltextview.cpp
Src/readme.txt

index 31fb442..2d81af0 100644 (file)
@@ -2815,7 +2815,8 @@ RecalcHorzScrollBar (BOOL bPositionOnly /*= FALSE*/ )
         }
       si.fMask = SIF_DISABLENOSCROLL | SIF_PAGE | SIF_POS | SIF_RANGE;
       si.nMin = 0;
-      si.nMax = GetMaxLineLength () - 1;
+      // Cheat longer line
+      si.nMax = GetMaxLineLength () * 2 - 1;
       si.nPage = GetScreenChars ();
       si.nPos = m_nOffsetChar;
     }
@@ -2833,7 +2834,8 @@ OnHScroll (UINT nSBCode, UINT nPos, CScrollBar * pScrollBar)
   VERIFY (GetScrollInfo (SB_HORZ, &si));
 
   int nPageChars = GetScreenChars ();
-  int nMaxLineLength = GetMaxLineLength ();
+  // Cheat longer line
+  int nMaxLineLength = GetMaxLineLength () * 2;
 
   int nNewOffset;
   switch (nSBCode)
@@ -3341,7 +3343,8 @@ EnsureVisible (CPoint pt)
   const int nScreenChars = GetScreenChars ();
   if (nActualPos > nNewOffset + nScreenChars)
     {
-      nNewOffset = nActualPos - nScreenChars;
+      // Add 10 chars width space after line
+      nNewOffset = nActualPos - nScreenChars + 10;
     }
   if (nActualPos < nNewOffset)
     {
@@ -3349,8 +3352,8 @@ EnsureVisible (CPoint pt)
     }
 
   const int nMaxLineLen = GetMaxLineLength ();
-  if (nNewOffset >= nMaxLineLen)
-    nNewOffset = nMaxLineLen - 1;
+  if (nNewOffset >= nMaxLineLen * 2)
+    nNewOffset = nMaxLineLen * 2 - 1;
   if (nNewOffset < 0)
     nNewOffset = 0;
 
index 3541213..7ec570a 100644 (file)
@@ -1,3 +1,7 @@
+2003-04-23 Kimmo
+ PATCH: [ 721939 ] Wider horiz scroll + more space after last char
+  editlib: ccrystaltextview.cpp
+
 2003-04-20 Perry
  Changed dynamic array to be CArray based
   editlib: ccrystaltextview.cpp