diff options
Diffstat (limited to 'src/PositionCache.cxx')
-rw-r--r-- | src/PositionCache.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index 0104b8660..d36e3e629 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -116,6 +116,10 @@ void LineLayout::Free() noexcept { bidiData.reset(); } +void LineLayout::ClearPositions() { + std::fill(&positions[0], &positions[maxLineLength + 2], 0.0f); +} + void LineLayout::Invalidate(ValidLevel validity_) noexcept { if (validity > validity_) validity = validity_; @@ -301,6 +305,15 @@ Point LineLayout::PointFromPosition(int posInLine, int lineHeight, PointEnd pe) return pt; } +XYPOSITION LineLayout::XInLine(Sci::Position index) const noexcept { + // For positions inside line return value from positions + // For positions after line return last position + 1.0 + if (index <= numCharsInLine) { + return positions[index]; + } + return positions[numCharsInLine] + 1.0; +} + int LineLayout::EndLineStyle() const noexcept { return styles[numCharsBeforeEOL > 0 ? numCharsBeforeEOL-1 : 0]; } |