From 0e3b1076abe9efe41952d12ab5dfb9de10fa1f88 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 13 May 2018 15:12:59 +1000 Subject: When line end characters are displayed, indicators are drawn under/over them. --- src/PositionCache.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/PositionCache.cxx') diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index 8ed0580bb..680afbacd 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -104,18 +104,18 @@ int LineLayout::LineStart(int line) const { } } -int LineLayout::LineLastVisible(int line) const { +int LineLayout::LineLastVisible(int line, Scope scope) const { if (line < 0) { return 0; } else if ((line >= lines-1) || !lineStarts) { - return numCharsBeforeEOL; + return scope == Scope::visibleOnly ? numCharsBeforeEOL : numCharsInLine; } else { return lineStarts[line+1]; } } -Range LineLayout::SubLineRange(int subLine) const { - return Range(LineStart(subLine), LineLastVisible(subLine)); +Range LineLayout::SubLineRange(int subLine, Scope scope) const { + return Range(LineStart(subLine), LineLastVisible(subLine, scope)); } bool LineLayout::InLine(int offset, int line) const { @@ -218,7 +218,7 @@ Point LineLayout::PointFromPosition(int posInLine, int lineHeight, PointEnd pe) } for (int subLine = 0; subLine < lines; subLine++) { - const Range rangeSubLine = SubLineRange(subLine); + const Range rangeSubLine = SubLineRange(subLine, Scope::visibleOnly); if (posInLine >= rangeSubLine.start) { pt.y = static_cast(subLine*lineHeight); if (posInLine <= rangeSubLine.end) { -- cgit v1.2.3