mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Fixed a line breaking issue
This commit is contained in:
parent
281b967e8f
commit
c80ba5be86
|
@ -882,7 +882,12 @@ void Font::wrapText(std::vector<ShapeSegment>& segmentsHB,
|
|||
// New row.
|
||||
size_t offset {0};
|
||||
|
||||
if (lastSpace == i && !lastSegmentSpace) {
|
||||
bool shapedSegmentChange {false};
|
||||
if (lastSpace == 0 && resultSegments.size() > 0 &&
|
||||
!resultSegments.back().lineBreak)
|
||||
shapedSegmentChange = true;
|
||||
|
||||
if (lastSpace == i && !lastSegmentSpace && !shapedSegmentChange) {
|
||||
if (segment.rightToLeft)
|
||||
newSegment.glyphIndexes.insert(newSegment.glyphIndexes.begin(),
|
||||
segment.glyphIndexes[i]);
|
||||
|
@ -906,6 +911,9 @@ void Font::wrapText(std::vector<ShapeSegment>& segmentsHB,
|
|||
spaceAccum = 0;
|
||||
}
|
||||
}
|
||||
else if (shapedSegmentChange) {
|
||||
offset = i;
|
||||
}
|
||||
else {
|
||||
if (lastSpace == 0)
|
||||
++spaceAccum;
|
||||
|
|
Loading…
Reference in a new issue