Merge pull request #1 from halvaborsch/halvaborsch-unicode-patch-1

[*] Make it wrap unicode messages in correct way.
merge-requests/1/head
Joram Wilander 2018-07-10 08:53:43 -04:00 committed by GitHub
commit 25f7aa81f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -185,9 +185,9 @@ func firstLine(face font.Face, text string, limit fixed.Int26_6) (string, fixed.
if width+advance > limit {
if lastBreak == 0 {
return text[:pos], width, text[pos:]
return string([]rune(text)[:pos]), width, string([]rune(text)[pos:])
}
return text[:lastBreak], lastBreakWidth, text[lastBreak:]
return string([]rune(text)[:lastBreak]), lastBreakWidth, string([]rune(text)[lastBreak:])
}
pos += 1