The previous implementation was a workaround for off-by-one bug in
ME_RunOfsFromCharOfs, this one relies on correct behavior of that function introduced by the previous patch.
This commit is contained in:
parent
9b748c8de2
commit
822ae486cd
@ -1724,10 +1724,15 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
|
|||||||
nCharOfs = lParam;
|
nCharOfs = lParam;
|
||||||
nLength = ME_GetTextLength(editor);
|
nLength = ME_GetTextLength(editor);
|
||||||
|
|
||||||
if (nCharOfs < nLength-1) {
|
if (nCharOfs < nLength) {
|
||||||
ME_RunOfsFromCharOfs(editor, nCharOfs, &pRun, &nOffset);
|
ME_RunOfsFromCharOfs(editor, nCharOfs, &pRun, &nOffset);
|
||||||
|
assert(pRun->type == diRun);
|
||||||
pt.y = pRun->member.run.pt.y;
|
pt.y = pRun->member.run.pt.y;
|
||||||
pt.x = pRun->member.run.pt.x + ME_PointFromChar(editor, &pRun->member.run, nOffset);
|
pt.x = pRun->member.run.pt.x + ME_PointFromChar(editor, &pRun->member.run, nOffset);
|
||||||
|
pt.y += ME_GetParagraph(pRun)->member.para.nYPos;
|
||||||
|
} else {
|
||||||
|
pt.x = 0;
|
||||||
|
pt.y = editor->pBuffer->pLast->member.para.nYPos;
|
||||||
}
|
}
|
||||||
pt.y += ME_GetParagraph(pRun)->member.para.nYPos;
|
pt.y += ME_GetParagraph(pRun)->member.para.nYPos;
|
||||||
if (wParam >= 0x40000) {
|
if (wParam >= 0x40000) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user