diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-04-08 19:54:34 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-04-08 19:54:34 +0300 |
commit | cf4041eb05471614bd6f4e38af5986ae9211ef7f (patch) | |
tree | dfc0bc1a14050e3ce2c84ddef5f881b76787e72a /source/blender | |
parent | 9960feb7e39fa832edac79dd5130236c8fbd1b30 (diff) |
UI: Widgets: Fix text edit cursor not drawing.
Actually it was drawn before the widget. Flushing widget cache and
everything is fine again.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 8 |
1 files changed, 8 insertions, 0 deletions
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); |