diff options
Diffstat (limited to 'src/PositionCache.cxx')
-rw-r--r-- | src/PositionCache.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index e2dd69e3a..543573b38 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<XYPOSITION>(subLine*lineHeight); if (posInLine <= rangeSubLine.end) { |