diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-22 23:04:06 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-24 12:10:08 +0300 |
commit | 1ba91ae2c02863b3fd97810e7bcee902dac58992 (patch) | |
tree | 54415920f37052edeca7855c7e60e16fddb30c03 /source/blender/editors | |
parent | 1da12885444c9743e474461f3d7364588d54344e (diff) |
UI: fix inconsistency in button rounding when zooming in.
Some widgets would have rounding relative to the button size, others
absolute. Now it's always absolute. Note changing Display Scale in the
user prefs is not zooming, the rounding still scales with that.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 14 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index a9bb3089175..a3b4cbe392c 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2148,7 +2148,7 @@ static struct uiWidgetColors wcol_option = { 1, 15, -15, 0, - 0.3333333f, + 0.2f, }; /* button that shows popup */ @@ -3162,7 +3162,7 @@ static void ui_draw_but_HSV_v(uiBut *but, const rcti *rect) bTheme *btheme = UI_GetTheme(); uiWidgetColors *wcol = &btheme->tui.wcol_numslider; uiWidgetBase wtb; - const float rad = wcol->roundness * BLI_rcti_size_x(rect); + const float rad = wcol->roundness * U.widget_unit; float x, y; float rgb[3], hsv[3], v; bool color_profile = but->block->color_profile; @@ -3250,7 +3250,7 @@ static void ui_draw_separator(const rcti *rect, uiWidgetColors *wcol) static void widget_numbut_draw(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, bool emboss) { uiWidgetBase wtb; - const float rad = wcol->roundness * BLI_rcti_size_y(rect); + const float rad = wcol->roundness * U.widget_unit; const int handle_width = min_ii(BLI_rcti_size_x(rect) / 3, BLI_rcti_size_y(rect) * 0.7f); if (state & UI_SELECT) @@ -3510,7 +3510,7 @@ static void widget_progressbar(uiBut *but, uiWidgetColors *wcol, rcti *rect, int /* round corners */ float value = but->a1; - float offs = wcol->roundness * BLI_rcti_size_y(&rect_prog); + float offs = wcol->roundness * U.widget_unit; float w = value * BLI_rcti_size_x(&rect_prog); /* ensure minimium size */ @@ -3546,7 +3546,7 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s /* backdrop first */ - offs = wcol->roundness * BLI_rcti_size_y(rect); + offs = wcol->roundness * U.widget_unit; toffs = offs * 0.75f; round_box_edges(&wtb, roundboxalign, rect, offs); @@ -3712,7 +3712,7 @@ static void widget_icon_has_anim(uiBut *but, uiWidgetColors *wcol, rcti *rect, i widget_init(&wtb); wtb.draw_outline = false; - rad = wcol->roundness * BLI_rcti_size_y(rect); + rad = wcol->roundness * U.widget_unit; round_box_edges(&wtb, UI_CNR_ALL, rect, rad); widgetbase_draw(&wtb, wcol); } @@ -3885,7 +3885,7 @@ static void widget_optionbut(uiWidgetColors *wcol, rcti *rect, int state, int UN recttemp.xmax -= delta; recttemp.ymax -= delta; - rad = wcol->roundness * BLI_rcti_size_y(&recttemp); + rad = wcol->roundness * U.widget_unit; round_box_edges(&wtb, UI_CNR_ALL, &recttemp, rad); /* decoration */ diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 1bc834a121c..593d935e8f3 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -2966,7 +2966,7 @@ void init_userdef_do_versions(void) btheme->tui.wcol_tool.roundness = 0.2f; btheme->tui.wcol_text.roundness = 0.2f; btheme->tui.wcol_radio.roundness = 0.2f; - btheme->tui.wcol_option.roundness = 0.333333f; + btheme->tui.wcol_option.roundness = 0.2f; btheme->tui.wcol_toggle.roundness = 0.25f; btheme->tui.wcol_num.roundness = 0.5f; btheme->tui.wcol_numslider.roundness = 0.5f; |