riched20: EM_CHARFROMPOS didn't work properly with scrolling

(vertical scrollbar position was not taken into account).
This commit is contained in:
Krzysztof Foltman 2006-06-18 22:21:23 +02:00 committed by Alexandre Julliard
parent f9b213ff7b
commit 8e85210144
1 changed files with 1 additions and 0 deletions

View File

@ -718,6 +718,7 @@ ME_CharFromPos(ME_TextEditor *editor, int x, int y)
GetClientRect(editor->hWnd, &rc);
if (x < 0 || y < 0 || x >= rc.right || y >= rc.bottom)
return -1;
y += ME_GetYScrollPos(editor);
ME_FindPixelPos(editor, x, y, &cursor, NULL);
return (ME_GetParagraph(cursor.pRun)->member.para.nCharOfs
+ cursor.pRun->member.run.nCharOfs + cursor.nOffset);