Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_widgets.c
| Show First 20 Lines • Show All 1,500 Lines • ▼ Show 20 Lines | if (icon && icon != ICON_BLANK1) { | ||||
| ys = (rect->ymin + rect->ymax - height) / 2.0f; | ys = (rect->ymin + rect->ymax - height) / 2.0f; | ||||
| /* force positions to integers, for zoom levels near 1. draws icons crisp. */ | /* force positions to integers, for zoom levels near 1. draws icons crisp. */ | ||||
| if (aspect > 0.95f && aspect < 1.05f) { | if (aspect > 0.95f && aspect < 1.05f) { | ||||
| xs = (int)(xs + 0.1f); | xs = (int)(xs + 0.1f); | ||||
| ys = (int)(ys + 0.1f); | ys = (int)(ys + 0.1f); | ||||
| } | } | ||||
| if (but->flag & UI_BUT_DISABLED) { | |||||
| UI_icon_draw_disabled(xs, ys, icon, aspect); | |||||
| } | |||||
| else if (but->dragpoin && (but->flag & UI_ACTIVE)) { | |||||
| /* to indicate draggable */ | /* to indicate draggable */ | ||||
| if (but->dragpoin && (but->flag & UI_ACTIVE)) { | |||||
| float rgb[3] = {1.25f, 1.25f, 1.25f}; | float rgb[3] = {1.25f, 1.25f, 1.25f}; | ||||
| UI_icon_draw_aspect_color(xs, ys, icon, aspect, rgb, mono_color); | UI_icon_draw_aspect_color(xs, ys, icon, aspect, rgb, mono_color); | ||||
| } | } | ||||
| else if ((but->flag & (UI_ACTIVE | UI_SELECT | UI_SELECT_DRAW)) || !UI_but_is_tool(but)) { | |||||
| UI_icon_draw_aspect(xs, ys, icon, aspect, alpha, mono_color); | |||||
| } | |||||
| else { | else { | ||||
| const bTheme *btheme = UI_GetTheme(); | const bTheme *btheme = UI_GetTheme(); | ||||
| UI_icon_draw_desaturate( | UI_icon_draw_desaturate( | ||||
| xs, ys, icon, aspect, alpha, 1.0 - btheme->tui.icon_saturation, mono_color); | xs, ys, icon, aspect, alpha, 1.0 - btheme->tui.icon_saturation, mono_color); | ||||
| } | } | ||||
| } | } | ||||
| GPU_blend(false); | GPU_blend(false); | ||||
| ▲ Show 20 Lines • Show All 3,731 Lines • Show Last 20 Lines | |||||