fix [#33121] crashing when srolling down in text editor !

This commit is contained in:
2012-11-09 03:36:38 +00:00
parent 41deb7b021
commit cf08068e10
5 changed files with 49 additions and 33 deletions

View File

@@ -1044,6 +1044,8 @@ static void ui_text_clip_cursor(uiFontStyle *fstyle, uiBut *but, rcti *rect)
ui_text_clip_give_prev_off(but);
len = strlen(but->drawstr);
bytes = BLI_str_utf8_size(BLI_str_find_prev_char_utf8(but->drawstr, but->drawstr + len));
if (bytes < 0)
bytes = 1;
but->drawstr[len - bytes] = 0;
}