diff options
| author | nyamatongwe <devnull@localhost> | 2000-11-08 23:13:51 +0000 |
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2000-11-08 23:13:51 +0000 |
| commit | ad252a3c0e0f2b94139aec8a97a4e7b16831a655 (patch) | |
| tree | 0b2b3f6e7003917dcc138cec7d56259caa2394b0 /src | |
| parent | ff143a55ec35a8f59970069e00e83785be0d5c3b (diff) | |
| download | scintilla-mirror-ad252a3c0e0f2b94139aec8a97a4e7b16831a655.tar.gz | |
Clipping redraw rectangles to client rectangle in Editor::RedrawRect.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Editor.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 3761154f3..48f5eb017 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -308,7 +308,21 @@ int Editor::PositionFromLineX(int line, int x) { void Editor::RedrawRect(PRectangle rc) { //Platform::DebugPrintf("Redraw %d %d - %d %d\n", rc.left, rc.top, rc.right, rc.bottom); - wDraw.InvalidateRectangle(rc); + + // Clip the redraw rectangle into the client area + PRectangle rcClient = GetClientRectangle(); + if (rc.top < rcClient.top) + rc.top = rcClient.top; + if (rc.bottom > rcClient.bottom) + rc.bottom = rcClient.bottom; + if (rc.left < rcClient.left) + rc.left = rcClient.left; + if (rc.right > rcClient.right) + rc.right = rcClient.right; + + if ((rc.bottom > rc.top) && (rc.right > rc.left)) { + wDraw.InvalidateRectangle(rc); + } } void Editor::Redraw() { |
