mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15: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.
|
// New row.
|
||||||
size_t offset {0};
|
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)
|
if (segment.rightToLeft)
|
||||||
newSegment.glyphIndexes.insert(newSegment.glyphIndexes.begin(),
|
newSegment.glyphIndexes.insert(newSegment.glyphIndexes.begin(),
|
||||||
segment.glyphIndexes[i]);
|
segment.glyphIndexes[i]);
|
||||||
|
@ -906,6 +911,9 @@ void Font::wrapText(std::vector<ShapeSegment>& segmentsHB,
|
||||||
spaceAccum = 0;
|
spaceAccum = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (shapedSegmentChange) {
|
||||||
|
offset = i;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
if (lastSpace == 0)
|
if (lastSpace == 0)
|
||||||
++spaceAccum;
|
++spaceAccum;
|
||||||
|
|
Loading…
Reference in a new issue