mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-09 07:15:11 -04:00
Fixed potential infinite loop in manual when splitting text.
This commit is contained in:
parent
08287b5f35
commit
bc97331b0d
@ -59,7 +59,9 @@ trait BasicTextSegment extends Segment {
|
||||
pos += 1
|
||||
val width = stringWidth(s.take(pos), renderer)
|
||||
if (width >= maxWidth) {
|
||||
if (lastBreak > 0 || fullWidth <= maxLineWidth || s.exists(breaks.contains)) return lastBreak + 1
|
||||
if (lastBreak > 0 || fullWidth <= maxLineWidth || s.exists(breaks.contains))
|
||||
if (maxWidth == maxLineWidth && fullWidth == maxLineWidth && !s.exists(breaks.contains)) return s.length
|
||||
else return lastBreak + 1
|
||||
else return pos - 1
|
||||
}
|
||||
if (pos < s.length && breaks.contains(s.charAt(pos))) lastBreak = pos
|
||||
|
Loading…
x
Reference in New Issue
Block a user