Commit 438d8e1c authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

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.
parent ee6b6f33
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment