Fix off-by-1 error in per-paragraph alignment

This commit is contained in:
Twan van Laarhoven
2020-05-12 22:26:12 +02:00
parent ed45c7efb8
commit 41ed84e678
+1 -1
View File
@@ -728,7 +728,7 @@ void TextViewer::alignLines(RotatedDC& dc, const vector<CharInfo>& chars, const
size_t start = 0;
int n = 0;
for (size_t last = 0 ; last < lines.size() ; ++last) {
if (lines[last].break_after != LineBreak::SOFT || last == lines.size()) {
if (lines[last].break_after != LineBreak::SOFT || last+1 == lines.size()) {
alignParagraph(start, last + 1, chars, style, RealRect(0, style.padding_top+n*style.paragraph_height, s.width, style.paragraph_height));
start = last + 1;
++n;