diff options
| author | nyamatongwe <unknown> | 2007-07-26 08:04:03 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2007-07-26 08:04:03 +0000 | 
| commit | b276c3978e151e0738536932273a0c3fae00a64f (patch) | |
| tree | 45eef4bb6dfafb520f5996624dde9bfc3f15d6e2 | |
| parent | 0746ffe96fa9eb97bf43c529b8118f7407d4bc0f (diff) | |
| download | scintilla-mirror-b276c3978e151e0738536932273a0c3fae00a64f.tar.gz | |
Optimised previous change to avoid extra redraws when modification does not
affect visible area.
| -rw-r--r-- | include/Platform.h | 3 | ||||
| -rw-r--r-- | src/Editor.cxx | 6 | ||||
| -rw-r--r-- | win32/ScintillaWin.cxx | 2 | 
3 files changed, 9 insertions, 2 deletions
diff --git a/include/Platform.h b/include/Platform.h index 6e6540007..79be33f6b 100644 --- a/include/Platform.h +++ b/include/Platform.h @@ -122,6 +122,9 @@ public:  	}  	int Width() { return right - left; }  	int Height() { return bottom - top; } +	bool Empty() {  +		return (Height() <= 0) || (Width() <= 0); +	}  };  /** diff --git a/src/Editor.cxx b/src/Editor.cxx index 187503256..4d10b6272 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -5471,7 +5471,11 @@ void Editor::SetFocusState(bool focusState) {  }  bool Editor::PaintContains(PRectangle rc) { -	return rcPaint.Contains(rc); +	if (rc.Empty()) { +		return true; +	} else { +		return rcPaint.Contains(rc); +	}  }  bool Editor::PaintContainsMargin() { diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index c7ed3ddfa..7fb12c97e 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -1069,7 +1069,7 @@ bool ScintillaWin::HaveMouseCapture() {  bool ScintillaWin::PaintContains(PRectangle rc) {  	bool contains = true; -	if (paintState == painting) { +	if ((paintState == painting) && (!rc.Empty())) {  		if (!rcPaint.Contains(rc)) {  			contains = false;  		} else {  | 
