diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-25 22:01:36 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-25 22:02:50 +0300 |
commit | 7a67bb7018b8be7b54ece0048a22df34923efe68 (patch) | |
tree | 433d2e77fe2ed8e9fd29db15f5d5996ff7ee25fa /source/blender/editors/interface/interface_icons.c | |
parent | 700012b66e87390a9eee33d4437a073cb8e42076 (diff) |
UI: workaround for text & icon alignment
Blender's icons weren't written to draw different sizes.
For now ifdef in a hack to show toolbar icons larger.
Diffstat (limited to 'source/blender/editors/interface/interface_icons.c')
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index e81ab44150f..e2d28fc7986 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1226,14 +1226,15 @@ static void icon_draw_size( /* We need to flush widget base first to ensure correct ordering. */ UI_widgetbase_draw_cache_flush(); +#ifdef USE_TOOLBAR_HACK /* TODO(campbell): scale icons up for toolbar, we need a way to detect larger buttons and do this automatic. */ { - /* Icons are currently 38 aligned, scale from 16 -> 38. */ - float scale = 2.375f; + float scale = (float)ICON_DEFAULT_HEIGHT_TOOLBAR / (float)ICON_DEFAULT_HEIGHT; y = (y + (h / 2)) - ((h * scale) / 2); w *= scale; h *= scale; } +#endif /* This could re-generate often if rendered at different sizes in the one interface. * TODO(campbell): support caching multiple sizes. */ |