richedit: Prevent redundant rewraps when scrollbar is shown.
A common case for richedit controls are that a large amount of text is set initially with word wrap enabled. This causes the initially wrapping of the text, which also calculates the text length. After this the vertical scrollbar will be shown, which causes the text to be rewrapped again. After this there are two redundant rewraps that are done which this patch eliminates.
This commit is contained in:
parent
a16db0afc6
commit
6df4148b04
|
@ -1099,14 +1099,7 @@ void ME_UpdateScrollBar(ME_TextEditor *editor)
|
|||
bScrollBarWillBeVisible = TRUE;
|
||||
}
|
||||
|
||||
if (bScrollBarWasVisible != bScrollBarWillBeVisible)
|
||||
{
|
||||
ShowScrollBar(hWnd, SB_VERT, bScrollBarWillBeVisible);
|
||||
ME_MarkAllForWrapping(editor);
|
||||
ME_WrapMarkedParagraphs(editor);
|
||||
}
|
||||
|
||||
si.nMin = 0;
|
||||
si.nMin = 0;
|
||||
si.nMax = editor->nTotalLength;
|
||||
si.nPos = editor->vert_si.nPos;
|
||||
si.nPage = editor->sizeWindow.cy;
|
||||
|
@ -1122,6 +1115,9 @@ void ME_UpdateScrollBar(ME_TextEditor *editor)
|
|||
if (bScrollBarWillBeVisible || bScrollBarWasVisible)
|
||||
SetScrollInfo(hWnd, SB_VERT, &si, TRUE);
|
||||
}
|
||||
|
||||
if (bScrollBarWasVisible != bScrollBarWillBeVisible)
|
||||
ShowScrollBar(hWnd, SB_VERT, bScrollBarWillBeVisible);
|
||||
}
|
||||
|
||||
int ME_GetYScrollPos(ME_TextEditor *editor)
|
||||
|
|
Loading…
Reference in New Issue