Commit 01ee55a8 authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

richedit: Clip painting to formatting rectangle.

parent d2b13825
...@@ -31,6 +31,16 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT * ...@@ -31,6 +31,16 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT *
ME_Context c; ME_Context c;
int yoffset; int yoffset;
int ys, ye; int ys, ye;
HRGN oldRgn;
oldRgn = CreateRectRgn(0, 0, 0, 0);
if (!GetClipRgn(hDC, oldRgn))
{
DeleteObject(oldRgn);
oldRgn = NULL;
}
IntersectClipRect(hDC, rcUpdate->left, rcUpdate->top,
rcUpdate->right, rcUpdate->bottom);
editor->nSequence++; editor->nSequence++;
yoffset = ME_GetYScrollPos(editor); yoffset = ME_GetYScrollPos(editor);
...@@ -107,6 +117,10 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT * ...@@ -107,6 +117,10 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, BOOL bOnlyNew, const RECT *
ME_SendRequestResize(editor, FALSE); ME_SendRequestResize(editor, FALSE);
editor->nLastTotalLength = editor->nTotalLength; editor->nLastTotalLength = editor->nTotalLength;
ME_DestroyContext(&c, NULL); ME_DestroyContext(&c, NULL);
SelectClipRgn(hDC, oldRgn);
if (oldRgn)
DeleteObject(oldRgn);
} }
void ME_Repaint(ME_TextEditor *editor) void ME_Repaint(ME_TextEditor *editor)
...@@ -1037,7 +1051,8 @@ static void ME_Scroll(ME_TextEditor *editor, int value, int type) ...@@ -1037,7 +1051,8 @@ static void ME_Scroll(ME_TextEditor *editor, int value, int type)
if (abs(nActualScroll) > editor->sizeWindow.cy) if (abs(nActualScroll) > editor->sizeWindow.cy)
InvalidateRect(editor->hWnd, NULL, TRUE); InvalidateRect(editor->hWnd, NULL, TRUE);
else else
ScrollWindowEx(editor->hWnd, 0, nActualScroll, NULL, NULL, NULL, NULL, SW_INVALIDATE); ScrollWindowEx(editor->hWnd, 0, nActualScroll, &editor->rcFormat,
&editor->rcFormat, NULL, NULL, SW_INVALIDATE);
ME_Repaint(editor); ME_Repaint(editor);
hWnd = editor->hWnd; hWnd = editor->hWnd;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment