Fix label stretch with lines ending in newline

This commit is contained in:
Nikita Lisitsa 2022-03-02 23:02:39 +03:00
parent 22c270ff6f
commit e06549f4dc

View file

@ -238,7 +238,7 @@ namespace psemek::ui
break;
case halignment::stretch:
offset[0] = bbox[0].min - x_range.min;
if (l + 1 != lines.size() && spaces > 0)
if ((l + 1 != lines.size() && text_[lines[l].second] != '\n') && spaces > 0)
space_extra = (bbox[0].length() - x_range.length()) / spaces;
break;
}