diff options
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() { |