riched20: Properly calculate control display height.
This commit is contained in:
parent
3d32315c9e
commit
0d4707c284
|
@ -1131,6 +1131,7 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) {
|
||||||
ed->pCursors[1].pRun = ME_FindItemFwd(ed->pBuffer->pFirst, diRun);
|
ed->pCursors[1].pRun = ME_FindItemFwd(ed->pBuffer->pFirst, diRun);
|
||||||
ed->pCursors[1].nOffset = 0;
|
ed->pCursors[1].nOffset = 0;
|
||||||
ed->nLastTotalLength = ed->nTotalLength = 0;
|
ed->nLastTotalLength = ed->nTotalLength = 0;
|
||||||
|
ed->nHeight = 0;
|
||||||
ed->nUDArrowX = -1;
|
ed->nUDArrowX = -1;
|
||||||
ed->nSequence = 0;
|
ed->nSequence = 0;
|
||||||
ed->rgbBackColor = -1;
|
ed->rgbBackColor = -1;
|
||||||
|
|
|
@ -291,6 +291,7 @@ typedef struct tagME_TextEditor
|
||||||
int nCursors;
|
int nCursors;
|
||||||
SIZE sizeWindow;
|
SIZE sizeWindow;
|
||||||
int nTotalLength, nLastTotalLength;
|
int nTotalLength, nLastTotalLength;
|
||||||
|
int nHeight;
|
||||||
int nUDArrowX;
|
int nUDArrowX;
|
||||||
int nSequence;
|
int nSequence;
|
||||||
COLORREF rgbBackColor;
|
COLORREF rgbBackColor;
|
||||||
|
|
|
@ -460,7 +460,7 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type)
|
||||||
hWnd = editor->hWnd;
|
hWnd = editor->hWnd;
|
||||||
si.cbSize = sizeof(si);
|
si.cbSize = sizeof(si);
|
||||||
bScrollBarWasVisible = ME_GetYScrollVisible(editor);
|
bScrollBarWasVisible = ME_GetYScrollVisible(editor);
|
||||||
bScrollBarWillBeVisible = editor->nTotalLength > editor->sizeWindow.cy;
|
bScrollBarWillBeVisible = editor->nHeight > editor->sizeWindow.cy;
|
||||||
|
|
||||||
if (bScrollBarWasVisible != bScrollBarWillBeVisible)
|
if (bScrollBarWasVisible != bScrollBarWillBeVisible)
|
||||||
{
|
{
|
||||||
|
|
|
@ -429,11 +429,13 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor) {
|
||||||
ME_InitContext(&c, editor, hDC);
|
ME_InitContext(&c, editor, hDC);
|
||||||
c.pt.x = 0;
|
c.pt.x = 0;
|
||||||
c.pt.y = 0;
|
c.pt.y = 0;
|
||||||
|
editor->nHeight = 0;
|
||||||
item = editor->pBuffer->pFirst->next;
|
item = editor->pBuffer->pFirst->next;
|
||||||
while(item != editor->pBuffer->pLast) {
|
while(item != editor->pBuffer->pLast) {
|
||||||
BOOL bRedraw = FALSE;
|
BOOL bRedraw = FALSE;
|
||||||
|
|
||||||
assert(item->type == diParagraph);
|
assert(item->type == diParagraph);
|
||||||
|
editor->nHeight = max(editor->nHeight, item->member.para.nYPos);
|
||||||
if ((item->member.para.nFlags & MEPF_REWRAP)
|
if ((item->member.para.nFlags & MEPF_REWRAP)
|
||||||
|| (item->member.para.nYPos != c.pt.y))
|
|| (item->member.para.nYPos != c.pt.y))
|
||||||
bRedraw = TRUE;
|
bRedraw = TRUE;
|
||||||
|
|
Loading…
Reference in New Issue