Commit: cf4041eb05471614bd6f4e38af5986ae9211ef7f
Author: Clément Foucault
Date:   Sun Apr 8 18:54:34 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBcf4041eb05471614bd6f4e38af5986ae9211ef7f

UI: Widgets: Fix text edit cursor not drawing.

Actually it was drawn before the widget. Flushing widget cache and
everything is fine again.

===================================================================

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 4b04c08a952..f15118d5f07 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -1711,6 +1711,10 @@ static void widget_draw_text(uiFontStyle *fstyle, 
uiWidgetColors *wcol, uiBut *b
                        int selsta_draw, selwidth_draw;
                        
                        if (drawstr[0] != 0) {
+                               /* We are drawing on top of widget bases. Flush 
cache. */
+                               glEnable(GL_BLEND);
+                               UI_widgetbase_draw_cache_flush();
+                               glDisable(GL_BLEND);
 
                                if (but->selsta >= but->ofs) {
                                        selsta_draw = 
BLF_width(fstyle->uifont_id, drawstr + but->ofs, but->selsta - but->ofs);
@@ -1752,6 +1756,10 @@ static void widget_draw_text(uiFontStyle *fstyle, 
uiWidgetColors *wcol, uiBut *b
                        else {
                                t = 0;
                        }
+                       /* We are drawing on top of widget bases. Flush cache. 
*/
+                       glEnable(GL_BLEND);
+                       UI_widgetbase_draw_cache_flush();
+                       glDisable(GL_BLEND);
 
                        unsigned int pos = 
GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, 
GWN_FETCH_INT_TO_FLOAT);
                        immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to