Fix: IME input displays text after cursor before cursor

When inserting text using IME on a button, the character after the cursor is
displayed before the cursor.

This bug seems to have occurred during the refactoring in D765.

Differential Revision: https://developer.blender.org/D11072
This commit is contained in:
Yuki Hashimoto 2021-07-05 13:29:09 +02:00 committed by Brecht Van Lommel
parent bd0de99b52
commit 32124b940e
1 changed files with 2 additions and 1 deletions

View File

@ -2013,7 +2013,8 @@ static void widget_draw_text(const uiFontStyle *fstyle,
/* insert composite string into cursor pos */
BLI_snprintf((char *)drawstr,
UI_MAX_DRAW_STR,
"%s%s%s",
"%.*s%s%s",
but->pos,
but->editstr,
ime_data->str_composite,
but->editstr + but->pos);