[*] Make it warp unicode messages coorect.

master
halvaborsch 2018-04-17 17:54:22 +07:00 committed by GitHub
parent 54988031d5
commit b73e9effbb
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