diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2019-08-01 18:05:53 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-08-01 18:05:53 +0300 |
commit | 03bbd5f9dedf7b3dfea7119c172c61f0b50ae28c (patch) | |
tree | 79ab34e79af6a700c6f73f331e4ee4e253ab3751 /source/blender/editors/interface/interface_draw.c | |
parent | 2204bfcf9e1c3a38e60830bd97775dd72158f4d6 (diff) | |
parent | 49b2162309da6abf66764d41d9fc4c45ad01936c (diff) |
Merge branch 'master' into temp-gpencil-drw-engine
Diffstat (limited to 'source/blender/editors/interface/interface_draw.c')
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 7afdbe9d266..6a36bf364a3 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1606,6 +1606,11 @@ void ui_draw_but_COLORBAND(uiBut *but, const uiWidgetColors *UNUSED(wcol), const float sizey_solid = sizey * 0.25f; float y1 = rect->ymin; + /* exit early if too narrow */ + if (sizex <= 0) { + return; + } + GPUVertFormat *format = immVertexFormat(); pos_id = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_CHECKER); |