Commit: 00ca7a03da4f6e757aa9f3254523f4945ae6d5c9
Author: Campbell Barton
Date: Mon Nov 25 13:40:54 2019 +1100
Branches: master
https://developer.blender.org/rB00ca7a03da4f6e757aa9f3254523f4945ae6d5c9
Fix WITH_INPUT_IME breakage in last commit
===================================================================
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 847ee37873b..df2b78e0a6f 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -2163,6 +2163,8 @@ static void widget_draw_text(const uiFontStyle *fstyle,
/* text button selection, cursor, composite underline */
if (but->editstr && but->pos != -1) {
int but_pos_ofs;
+ /* Shape of the cursor for drawing. */
+ rcti but_cursor_shape;
/* text button selection */
if ((but->selend - but->selsta) > 0) {
@@ -2227,12 +2229,17 @@ static void widget_draw_text(const uiFontStyle *fstyle,
immUniformColor3f(0.2f, 0.6f, 0.9f);
+ but_cursor_shape.xmin = (rect->xmin + t) - U.pixelsize;
+ but_cursor_shape.ymin = rect->ymin + U.pixelsize;
+ but_cursor_shape.xmax = (rect->xmin + t) + U.pixelsize;
+ but_cursor_shape.ymax = rect->ymax - U.pixelsize;
+
/* draw cursor */
immRecti(pos,
- rect->xmin + t - U.pixelsize,
- rect->ymin + U.pixelsize,
- rect->xmin + t + U.pixelsize,
- rect->ymax - U.pixelsize);
+ but_cursor_shape.xmin,
+ but_cursor_shape.ymin,
+ but_cursor_shape.xmax,
+ but_cursor_shape.ymax);
immUnbindProgram();
}
@@ -2241,7 +2248,7 @@ static void widget_draw_text(const uiFontStyle *fstyle,
if (ime_data && ime_data->composite_len) {
/* ime cursor following */
if (but->pos >= but->ofs) {
- ui_but_ime_reposition(but, tx + 5, ty + 3, false);
+ ui_but_ime_reposition(but, but_cursor_shape.xmax + 5,
but_cursor_shape.ymin + 3, false);
}
/* composite underline */
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs