diff options
author | Zufu Liu <unknown> | 2023-02-12 11:26:48 +1100 |
---|---|---|
committer | Zufu Liu <unknown> | 2023-02-12 11:26:48 +1100 |
commit | 5848ae9e694b196e24f10e830c517e0f613b80ae (patch) | |
tree | daf86b3a99c25733c884d512bace47ea12c5dd6c /src/PositionCache.cxx | |
parent | f2455fabf07576db6224262ce8b62a59429534e3 (diff) | |
download | scintilla-mirror-5848ae9e694b196e24f10e830c517e0f613b80ae.tar.gz |
Bug [#2378]. Fix overlapping of text with line end wrap marker.
Diffstat (limited to 'src/PositionCache.cxx')
-rw-r--r-- | src/PositionCache.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index a0aece160..a0b7f3129 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -326,7 +326,7 @@ int LineLayout::EndLineStyle() const noexcept { return styles[numCharsBeforeEOL > 0 ? numCharsBeforeEOL-1 : 0]; } -void LineLayout::WrapLine(const Document *pdoc, Sci::Position posLineStart, Wrap wrapState) { +void LineLayout::WrapLine(const Document *pdoc, Sci::Position posLineStart, Wrap wrapState, XYPOSITION wrapWidth) { // Document wants document positions but simpler to work in line positions // so take care of adding and subtracting line start in a lambda. auto CharacterBoundary = [=](Sci::Position i, Sci::Position moveDir) noexcept -> Sci::Position { @@ -335,7 +335,7 @@ void LineLayout::WrapLine(const Document *pdoc, Sci::Position posLineStart, Wrap lines = 0; // Calculate line start positions based upon width. Sci::Position lastLineStart = 0; - XYPOSITION startOffset = widthLine; + XYPOSITION startOffset = wrapWidth; Sci::Position p = 0; while (p < numCharsInLine) { while (p < numCharsInLine && positions[p + 1] < startOffset) { @@ -377,7 +377,7 @@ void LineLayout::WrapLine(const Document *pdoc, Sci::Position posLineStart, Wrap AddLineStart(lastLineStart); startOffset = positions[lastLineStart]; // take into account the space for start wrap mark and indent - startOffset += widthLine - wrapIndent; + startOffset += wrapWidth - wrapIndent; p = lastLineStart + 1; } } |