richedit: Prevent autoscrolling without ES_AUTO[VH]SCROLL style.
When the richedit control is created without the ES_AUTOHSCROLL or the ES_AUTOVSCROLL, then scrolling isn't done automatically when moving the cursor with the arrow keys, drag selecting with the mouse, or even from using the EM_SCROLLCARET (based on testing using a modified version of wordpad).
This commit is contained in:
parent
fe459ad85f
commit
140fee1790
|
@ -1242,11 +1242,21 @@ void ME_EnsureVisible(ME_TextEditor *editor, ME_Cursor *pCursor)
|
||||||
assert(pRow);
|
assert(pRow);
|
||||||
assert(pPara);
|
assert(pPara);
|
||||||
|
|
||||||
x = pRun->pt.x + ME_PointFromChar(editor, pRun, pCursor->nOffset);
|
if (editor->styleFlags & ES_AUTOHSCROLL)
|
||||||
if (x > editor->horz_si.nPos + editor->sizeWindow.cx)
|
{
|
||||||
x = x + 1 - editor->sizeWindow.cx;
|
x = pRun->pt.x + ME_PointFromChar(editor, pRun, pCursor->nOffset);
|
||||||
else if (x > editor->horz_si.nPos)
|
if (x > editor->horz_si.nPos + editor->sizeWindow.cx)
|
||||||
|
x = x + 1 - editor->sizeWindow.cx;
|
||||||
|
else if (x > editor->horz_si.nPos)
|
||||||
|
x = editor->horz_si.nPos;
|
||||||
|
|
||||||
|
if (~editor->styleFlags & ES_AUTOVSCROLL)
|
||||||
|
ME_HScrollAbs(editor, x);
|
||||||
|
} else {
|
||||||
|
if (~editor->styleFlags & ES_AUTOVSCROLL)
|
||||||
|
return;
|
||||||
x = editor->horz_si.nPos;
|
x = editor->horz_si.nPos;
|
||||||
|
}
|
||||||
|
|
||||||
y = pPara->member.para.pt.y + pRow->member.row.pt.y;
|
y = pPara->member.para.pt.y + pRow->member.row.pt.y;
|
||||||
yheight = pRow->member.row.nHeight;
|
yheight = pRow->member.row.nHeight;
|
||||||
|
|
Loading…
Reference in New Issue