From 8e852101447eb60aa4ed361f863306cc3e076b96 Mon Sep 17 00:00:00 2001 From: Krzysztof Foltman Date: Sun, 18 Jun 2006 22:21:23 +0200 Subject: [PATCH] riched20: EM_CHARFROMPOS didn't work properly with scrolling (vertical scrollbar position was not taken into account). --- dlls/riched20/caret.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index 0ae347a90c..057e5d867d 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -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);