Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-04-10 18:42:33 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-04-10 18:42:45 +0300
commit3dce5b2ef9f7881c13b50476802e4db1608955be (patch)
tree66cc164e87d796dddb1f5845004f218128432c49 /source/blender/editors/interface/interface_widgets.c
parent04e363376ba234e860c73340f073df619e563a24 (diff)
UI: Fix some drawing order issues.
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r--source/blender/editors/interface/interface_widgets.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index f15118d5f07..5a210d01f27 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -3043,6 +3043,11 @@ static void ui_draw_but_HSV_v(uiBut *but, const rcti *rect)
widgetbase_draw(&wtb, &wcol_tmp);
+ /* We are drawing on top of widget bases. Flush cache. */
+ glEnable(GL_BLEND);
+ UI_widgetbase_draw_cache_flush();
+ glDisable(GL_BLEND);
+
/* cursor */
x = rect->xmin + 0.5f * BLI_rcti_size_x(rect);
y = rect->ymin + v * BLI_rcti_size_y(rect);
@@ -3513,7 +3518,6 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat
}
widgetbase_draw(&wtb, wcol);
-
if (but->a1 == UI_PALETTE_COLOR && ((Palette *)but->rnapoin.id.data)->active_color == (int)but->a2) {
float width = rect->xmax - rect->xmin;
float height = rect->ymax - rect->ymin;
@@ -3522,6 +3526,11 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat
bw += (bw < 0.5f) ? 0.5f : -0.5f;
+ /* 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_F32, 2, GWN_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
@@ -3879,6 +3888,11 @@ static void widget_tab(uiBut *but, uiWidgetColors *wcol, rcti *rect, int UNUSED(
wtb.draw_outline = 0;
widgetbase_draw(&wtb, wcol);
+ /* We are drawing on top of widget bases. Flush cache. */
+ glEnable(GL_BLEND);
+ UI_widgetbase_draw_cache_flush();
+ glDisable(GL_BLEND);
+
/* draw outline (3d look) */
ui_draw_but_TAB_outline(rect, rad, theme_col_tab_highlight, (unsigned char *)wcol->inner);