Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_icons.c
| Show First 20 Lines • Show All 1,758 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| bTheme *btheme = UI_GetTheme(); | bTheme *btheme = UI_GetTheme(); | ||||
| Icon *icon = NULL; | Icon *icon = NULL; | ||||
| IconImage *iimg; | IconImage *iimg; | ||||
| const float fdraw_size = (float)draw_size; | const float fdraw_size = (float)draw_size; | ||||
| int w, h; | int w, h; | ||||
| icon = BKE_icon_get(icon_id); | icon = BKE_icon_get(icon_id); | ||||
| alpha *= btheme->tui.icon_alpha; | |||||
| if (icon == NULL) { | if (icon == NULL) { | ||||
| if (G.debug & G_DEBUG) { | if (G.debug & G_DEBUG) { | ||||
| printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id); | printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id); | ||||
| } | } | ||||
| return; | return; | ||||
| } | } | ||||
| /* scale width and height according to aspect */ | /* scale width and height according to aspect */ | ||||
| w = (int)(fdraw_size / aspect + 0.5f); | w = (int)(fdraw_size / aspect + 0.5f); | ||||
| h = (int)(fdraw_size / aspect + 0.5f); | h = (int)(fdraw_size / aspect + 0.5f); | ||||
| DrawInfo *di = icon_ensure_drawinfo(icon); | DrawInfo *di = icon_ensure_drawinfo(icon); | ||||
| if (ELEM(di->type, ICON_TYPE_VECTOR, ICON_TYPE_MONO_TEXTURE, ICON_TYPE_GEOM)) { | |||||
| alpha *= btheme->tui.icon_alpha; | |||||
| } | |||||
Severin: Event icons may be mixed with other icons, so we should apply alpha for them too, otherwise… | |||||
| /* We need to flush widget base first to ensure correct ordering. */ | /* We need to flush widget base first to ensure correct ordering. */ | ||||
| UI_widgetbase_draw_cache_flush(); | UI_widgetbase_draw_cache_flush(); | ||||
| if (di->type == ICON_TYPE_VECTOR) { | if (di->type == ICON_TYPE_VECTOR) { | ||||
| /* vector icons use the uiBlock transformation, they are not drawn | /* vector icons use the uiBlock transformation, they are not drawn | ||||
| * with untransformed coordinates like the other icons */ | * with untransformed coordinates like the other icons */ | ||||
| di->data.vector.func((int)x, (int)y, w, h, 1.0f); | di->data.vector.func((int)x, (int)y, w, h, 1.0f); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 586 Lines • Show Last 20 Lines | |||||
Event icons may be mixed with other icons, so we should apply alpha for them too, otherwise:
Note that this is already an issue in master, but that's separate. So I'd just add ICON_TYPE_EVENT here.