[Bf-blender-cvs] [32124b940ee] master: Fix: IME input displays text after cursor before cursor
Yuki Hashimoto
noreply at git.blender.org
Mon Jul 5 14:32:40 CEST 2021
Commit: 32124b940ee65b844a8a0e13ed0377e24c65fcc7
Author: Yuki Hashimoto
Date: Mon Jul 5 13:29:09 2021 +0200
Branches: master
https://developer.blender.org/rB32124b940ee65b844a8a0e13ed0377e24c65fcc7
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
===================================================================
M source/blender/editors/interface/interface_widgets.c
===================================================================
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 12c70f77864..3a8d7da1492 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -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);
More information about the Bf-blender-cvs
mailing list