aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2014-04-22 10:33:42 +1000
committerNeil Hodgson <nyamatongwe@gmail.com>2014-04-22 10:33:42 +1000
commit190b22e75c6adc9f6d11401dc7e19e2196249462 (patch)
treefb0420c81f6ba07e16f229ee6fa87b813b7d3350
parentee2e64f273fc1b44273ee61edbde6c159ee4c080 (diff)
downloadscintilla-mirror-190b22e75c6adc9f6d11401dc7e19e2196249462.tar.gz
Bug [#1593]. Fix drawing bug on Cocoa where previous caret lines were visible
due to using the visible area instead of the whole drawing area.
-rw-r--r--src/Editor.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index e9489123e..1b51f7426 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -712,14 +712,15 @@ void Editor::RedrawSelMargin(int line, bool allAfter) {
PRectangle Editor::RectangleFromRange(Range r) {
const int minLine = cs.DisplayFromDoc(pdoc->LineFromPosition(r.First()));
const int maxLine = cs.DisplayLastFromDoc(pdoc->LineFromPosition(r.Last()));
- PRectangle rcClient = GetTextRectangle();
+ const PRectangle rcClientDrawing = GetClientDrawingRectangle();
PRectangle rc;
const int leftTextOverlap = ((xOffset == 0) && (vs.leftMarginWidth > 0)) ? 1 : 0;
rc.left = vs.textStart - leftTextOverlap;
rc.top = (minLine - TopLineOfMain()) * vs.lineHeight;
- if (rc.top < rcClient.top)
- rc.top = rcClient.top;
- rc.right = rcClient.right;
+ if (rc.top < rcClientDrawing.top)
+ rc.top = rcClientDrawing.top;
+ // Extend to right of prepared area if any to prevent artifacts from caret line highlight
+ rc.right = rcClientDrawing.right;
rc.bottom = (maxLine - TopLineOfMain() + 1) * vs.lineHeight;
return rc;