diff options
author | Zufu Liu <unknown> | 2022-01-22 13:41:15 +1100 |
---|---|---|
committer | Zufu Liu <unknown> | 2022-01-22 13:41:15 +1100 |
commit | 715a474013efcbe331ec184bf295138a7194004e (patch) | |
tree | 88d1146aeb4ca7f0fdd6b22874f8f0827cc90f5f /src/EditView.cxx | |
parent | a3fff53a48e63064b14f7a1842b20f260bc5a9bc (diff) | |
download | scintilla-mirror-715a474013efcbe331ec184bf295138a7194004e.tar.gz |
Feature [feature-requests:#1422] Minor improvements to line layout and wrapping.
May avoid some small costs and be clearer.
Diffstat (limited to 'src/EditView.cxx')
-rw-r--r-- | src/EditView.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx index 527b829bf..ca78f9bad 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -462,7 +462,7 @@ void EditView::LayoutLine(const EditModel &model, Surface *surface, const ViewSt // Layout the line, determining the position of each character, // with an extra element at the end for the end of the line. - ll->positions[0] = 0; + std::fill(&ll->positions[0], &ll->positions[lineLength + 1], 0.0); bool lastSegItalics = false; BreakFinder bfLayout(ll, nullptr, Range(0, numCharsInLine), posLineStart, 0, BreakFinder::BreakFor::Text, model.pdoc, &model.reprs, nullptr); @@ -470,7 +470,6 @@ void EditView::LayoutLine(const EditModel &model, Surface *surface, const ViewSt const TextSegment ts = bfLayout.Next(); - std::fill(&ll->positions[ts.start + 1], &ll->positions[ts.end() + 1], 0.0f); if (vstyle.styles[ll->styles[ts.start]].visible) { if (ts.representation) { XYPOSITION representationWidth = vstyle.controlCharWidth; @@ -510,7 +509,7 @@ void EditView::LayoutLine(const EditModel &model, Surface *surface, const ViewSt lastSegItalics = (!ts.representation) && ((ll->chars[ts.end() - 1] != ' ') && vstyle.styles[ll->styles[ts.start]].italic); } - for (Sci::Position posToIncrease = ts.start + 1; posToIncrease <= ts.end(); posToIncrease++) { + for (int posToIncrease = ts.start + 1; posToIncrease <= ts.end(); posToIncrease++) { ll->positions[posToIncrease] += ll->positions[ts.start]; } } |