Fix `widget_draw_preview()` not taking into account given alpha.
Needed to get correct 'inactive' effect on buttons with big previews.
This commit is contained in:
parent
e092a58fb5
commit
1ac0fef345
|
@ -64,7 +64,7 @@ void UI_id_icon_render(
|
|||
void UI_icon_draw(float x, float y, int icon_id);
|
||||
void UI_icon_draw_preview(float x, float y, int icon_id);
|
||||
void UI_icon_draw_preview_aspect(float x, float y, int icon_id, float aspect);
|
||||
void UI_icon_draw_preview_aspect_size(float x, float y, int icon_id, float aspect, int size);
|
||||
void UI_icon_draw_preview_aspect_size(float x, float y, int icon_id, float aspect, float alpha, int size);
|
||||
|
||||
void UI_icon_draw_aspect(float x, float y, int icon_id, float aspect, float alpha);
|
||||
void UI_icon_draw_aspect_color(float x, float y, int icon_id, float aspect, const float rgb[3]);
|
||||
|
|
|
@ -1433,8 +1433,8 @@ void UI_icon_draw_preview_aspect(float x, float y, int icon_id, float aspect)
|
|||
icon_draw_at_size(x, y, icon_id, aspect, 1.0f, ICON_SIZE_PREVIEW, 0);
|
||||
}
|
||||
|
||||
void UI_icon_draw_preview_aspect_size(float x, float y, int icon_id, float aspect, int size)
|
||||
void UI_icon_draw_preview_aspect_size(float x, float y, int icon_id, float aspect, float alpha, int size)
|
||||
{
|
||||
icon_draw_size(x, y, icon_id, aspect, 1.0f, NULL, ICON_SIZE_PREVIEW, size, false, true);
|
||||
icon_draw_size(x, y, icon_id, aspect, alpha, NULL, ICON_SIZE_PREVIEW, size, false, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -807,7 +807,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
|
|||
|
||||
#define PREVIEW_PAD 4
|
||||
|
||||
static void widget_draw_preview(BIFIconID icon, float UNUSED(alpha), const rcti *rect)
|
||||
static void widget_draw_preview(BIFIconID icon, float alpha, const rcti *rect)
|
||||
{
|
||||
int w, h, size;
|
||||
|
||||
|
@ -823,7 +823,7 @@ static void widget_draw_preview(BIFIconID icon, float UNUSED(alpha), const rcti
|
|||
int x = rect->xmin + w / 2 - size / 2;
|
||||
int y = rect->ymin + h / 2 - size / 2;
|
||||
|
||||
UI_icon_draw_preview_aspect_size(x, y, icon, 1.0f, size);
|
||||
UI_icon_draw_preview_aspect_size(x, y, icon, 1.0f, alpha, size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue