Matt Finnicum : riched20: Use CharFromPos instead of FindPixelPos in LinkNotify so it accounts for scrolling .

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jan 24 06:18:32 CST 2007


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

Author: Matt Finnicum <mattfinn at gmail.com>
Date:   Tue Jan 23 14:44:29 2007 -0600

riched20: Use CharFromPos instead of FindPixelPos in LinkNotify so it accounts for scrolling.

---

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

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index a06d2f4..9b1904d 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -2581,15 +2581,18 @@ void ME_LinkNotify(ME_TextEditor *editor
 {
   int x,y;
   ME_Cursor tmpCursor;
+  int nCharOfs; /* The start of the clicked text. Absolute character offset */
+
   ME_Run *tmpRun;
-  BOOL bNothing;
+
   ENLINK info;
   x = (short)LOWORD(lParam);
   y = (short)HIWORD(lParam);
-  ME_FindPixelPos(editor, x, y, &tmpCursor, &bNothing);
+  nCharOfs = ME_CharFromPos(editor, x, y);
+  ME_CursorFromCharOfs(editor, nCharOfs, &tmpCursor);
   tmpRun = &tmpCursor.pRun->member.run;
-	
-  if ((tmpRun->style->fmt.dwMask & CFM_LINK) 
+
+  if ((tmpRun->style->fmt.dwMask & CFM_LINK)
     && (tmpRun->style->fmt.dwEffects & CFE_LINK))
   { /* The clicked run has CFE_LINK set */
     info.nmhdr.hwndFrom = editor->hWnd;




More information about the wine-cvs mailing list