OSDN Git Service

Cosmetic fix: CCrystalEditView::ShowDropIndicator() was at times unexpectedly hiding...
authorJochen Tucht <jtuc@users.sourceforge.net>
Mon, 11 Feb 2008 16:38:26 +0000 (16:38 +0000)
committerJochen Tucht <jtuc@users.sourceforge.net>
Mon, 11 Feb 2008 16:38:26 +0000 (16:38 +0000)
Src/editlib/ccrystaleditview.cpp

index dbf2ce9..4e987fe 100644 (file)
@@ -1201,9 +1201,11 @@ ShowDropIndicator (const CPoint & point)
       ::CreateCaret (m_hWnd, (HBITMAP) 1, 2, GetLineHeight ());
     }
   m_ptDropPos = ClientToText (point);
-  if (m_ptDropPos.x >= m_nOffsetChar)
+  // NB: m_ptDropPos.x is index into char array, which is uncomparable to m_nOffsetChar.
+  CPoint ptCaretPos = TextToClient (m_ptDropPos);
+  if (ptCaretPos.x >= GetMarginWidth())
     {
-      SetCaretPos (TextToClient (m_ptDropPos));
+      SetCaretPos (ptCaretPos);
       ShowCaret ();
     }
   else