diff options
| author | nyamatongwe <unknown> | 2000-11-08 23:13:51 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2000-11-08 23:13:51 +0000 | 
| commit | 36849951c6c20b566ba2dcf1b47bb8e157c480e5 (patch) | |
| tree | 0b2b3f6e7003917dcc138cec7d56259caa2394b0 | |
| parent | 549e14822e0483a9f989fd4d485bf19f6a4bf4df (diff) | |
| download | scintilla-mirror-36849951c6c20b566ba2dcf1b47bb8e157c480e5.tar.gz | |
Clipping redraw rectangles to client rectangle in Editor::RedrawRect.
| -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() { | 
