Fix #29443: Outliner buttons hover on shrink

Issue was caused by drawing icon instead of button due to column clip.
This icons was drawing without taking icons' alpha into account.
This commit is contained in:
Sergey Sharybin 2011-11-29 08:36:24 +00:00
parent 3f57c06c7b
commit a507954084

@ -893,9 +893,11 @@ struct DrawIconArg {
static void tselem_draw_icon_uibut(struct DrawIconArg *arg, int icon)
{
/* restrict collumn clip... it has been coded by simply overdrawing, doesnt work for buttons */
if(arg->x >= arg->xmax)
UI_icon_draw(arg->x, arg->y, icon);
else {
if(arg->x >= arg->xmax) {
glEnable(GL_BLEND);
UI_icon_draw_aspect(arg->x, arg->y, icon, 1.0f, arg->alpha);
glDisable(GL_BLEND);
} else {
/* XXX investigate: button placement of icons is way different than UI_icon_draw? */
float ufac= UI_UNIT_X/20.0f;
uiBut *but= uiDefIconBut(arg->block, LABEL, 0, icon, arg->x-3.0f*ufac, arg->y, UI_UNIT_X-4.0f*ufac, UI_UNIT_Y-4.0f*ufac, NULL, 0.0, 0.0, 1.0, arg->alpha, (arg->id && arg->id->lib) ? arg->id->lib->name : "");