riched20: Use CharFromPos instead of FindPixelPos in LinkNotify so it accounts for scrolling.
This commit is contained in:
parent
dbcf2e391c
commit
f12e6232a2
|
@ -2581,12 +2581,15 @@ void ME_LinkNotify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam
|
||||||
{
|
{
|
||||||
int x,y;
|
int x,y;
|
||||||
ME_Cursor tmpCursor;
|
ME_Cursor tmpCursor;
|
||||||
|
int nCharOfs; /* The start of the clicked text. Absolute character offset */
|
||||||
|
|
||||||
ME_Run *tmpRun;
|
ME_Run *tmpRun;
|
||||||
BOOL bNothing;
|
|
||||||
ENLINK info;
|
ENLINK info;
|
||||||
x = (short)LOWORD(lParam);
|
x = (short)LOWORD(lParam);
|
||||||
y = (short)HIWORD(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;
|
tmpRun = &tmpCursor.pRun->member.run;
|
||||||
|
|
||||||
if ((tmpRun->style->fmt.dwMask & CFM_LINK)
|
if ((tmpRun->style->fmt.dwMask & CFM_LINK)
|
||||||
|
|
Loading…
Reference in New Issue