diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-25 18:24:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-25 18:26:45 +0300 |
commit | f69feb4957028b2d2d5bba81ef75686d10f03090 (patch) | |
tree | 11c35e8c0c2cd330cd713a3d5f9a1d6fbffcf20e /source/blender/editors | |
parent | 89bcc80c254590f451e6d503d3b4470999a5b98a (diff) |
UI: optionally pass icon size to widget_draw_icon
No functional changes.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 9a1d47e0154..f1f193f1b02 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -868,9 +868,9 @@ static int ui_but_draw_menu_icon(const uiBut *but) /* icons have been standardized... and this call draws in untransformed coordinates */ -static void widget_draw_icon( - const uiBut *but, BIFIconID icon, float alpha, const rcti *rect, - const bool show_menu_icon) +static void widget_draw_icon_ex( + const uiBut *but, BIFIconID icon, float alpha, const rcti *rect, const bool show_menu_icon, + const int icon_size) { float xs = 0.0f, ys = 0.0f; float aspect, height; @@ -886,7 +886,7 @@ static void widget_draw_icon( if (icon == ICON_BLANK1 && (but->flag & UI_BUT_ICON_SUBMENU) == 0) return; aspect = but->block->aspect / UI_DPI_FAC; - height = ICON_DEFAULT_HEIGHT / aspect; + height = icon_size / aspect; /* calculate blend color */ if (ELEM(but->type, UI_BTYPE_TOGGLE, UI_BTYPE_ROW, UI_BTYPE_TOGGLE_N, UI_BTYPE_LISTROW)) { @@ -950,6 +950,12 @@ static void widget_draw_icon( glDisable(GL_BLEND); } +static void widget_draw_icon( + const uiBut *but, BIFIconID icon, float alpha, const rcti *rect, const bool show_menu_icon) +{ + widget_draw_icon_ex(but, icon, alpha, rect, show_menu_icon, ICON_DEFAULT_HEIGHT); +} + static void ui_text_clip_give_prev_off(uiBut *but, const char *str) { const char *prev_utf8 = BLI_str_find_prev_char_utf8(str, str + but->ofs); |