diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-25 18:27:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-25 18:27:23 +0300 |
commit | 01136931292e6084a8571f24145c5d9738bf9ff6 (patch) | |
tree | 5c822c1f64dd53098beb5598f3c7e1ca77bc0b18 | |
parent | e584f3d8d2ad34e4664f6022d32c81c2de6dfcda (diff) | |
parent | f69feb4957028b2d2d5bba81ef75686d10f03090 (diff) |
Merge branch 'master' into blender2.8
-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 a9bb3089175..87320d9ccc8 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1255,9 +1255,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; @@ -1273,7 +1273,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)) { @@ -1337,6 +1337,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); |