Dylan Smith : richedit: Caret size must match font size characters to be inserted.

Alexandre Julliard julliard at winehq.org
Fri Jun 27 07:41:50 CDT 2008


Module: wine
Branch: master
Commit: 438d8e1c58d03ee0e3804b3f6cc427ac2a2e3baf
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=438d8e1c58d03ee0e3804b3f6cc427ac2a2e3baf

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Thu Jun 26 16:17:32 2008 -0400

richedit: Caret size must match font size characters to be inserted.

When the caret is at the start of a run, it uses the font of the
previous run for inserting characters.  The caret size previously was
the wrong height for the characters being inserted when the caret was at
the start of a line, but not the start of a paragraph so this patch
fixes this bug.

---

 dlls/riched20/caret.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c
index 9f012be..a3a3d61 100644
--- a/dlls/riched20/caret.c
+++ b/dlls/riched20/caret.c
@@ -181,9 +181,9 @@ ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor,
     
       ME_InitContext(&c, editor, hDC);
       
-      if (!pCursor->nOffset && !editor->bCaretAtEnd)
+      if (!pCursor->nOffset)
       {
-        ME_DisplayItem *prev = ME_FindItemBack(pCursorRun, diRunOrStartRow);
+        ME_DisplayItem *prev = ME_FindItemBack(pCursorRun, diRunOrParagraph);
         assert(prev);
         if (prev->type == diRun)
           pSizeRun = prev;
@@ -215,8 +215,7 @@ ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor,
 
       *height = pSizeRun->member.run.nAscent + pSizeRun->member.run.nDescent;
       *x = run->member.run.pt.x + sz.cx;
-      *y = para->member.para.nYPos + row->member.row.nBaseline + pSizeRun->member.run.pt.y - pSizeRun->member.run.nAscent - ME_GetYScrollPos(editor);
-
+      *y = para->member.para.nYPos + row->member.row.nBaseline + run->member.run.pt.y - pSizeRun->member.run.nAscent - ME_GetYScrollPos(editor);
       ME_DestroyContext(&c, editor->hWnd);
       return;
     }




More information about the wine-cvs mailing list