From 190b22e75c6adc9f6d11401dc7e19e2196249462 Mon Sep 17 00:00:00 2001 From: Neil Hodgson Date: Tue, 22 Apr 2014 10:33:42 +1000 Subject: 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. --- src/Editor.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') 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; -- cgit v1.2.3