Revert "UI: fix inconsistency in button rounding when zooming in."

This isn't working well when zoomed out in the properties editor,
we should be taking into account properties editor zoom level.

This reverts commit 1ba91ae2c0.
This commit is contained in:
2018-04-25 11:53:21 +02:00
parent cc7460eaa4
commit a9d3f9f54d
2 changed files with 8 additions and 8 deletions

View File

@@ -2148,7 +2148,7 @@ static struct uiWidgetColors wcol_option = {
1,
15, -15,
0,
0.2f,
0.3333333f,
};
/* 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 * U.widget_unit;
const float rad = wcol->roundness * BLI_rcti_size_x(rect);
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 * U.widget_unit;
const float rad = wcol->roundness * BLI_rcti_size_y(rect);
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 * U.widget_unit;
float offs = wcol->roundness * BLI_rcti_size_y(&rect_prog);
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 * U.widget_unit;
offs = wcol->roundness * BLI_rcti_size_y(rect);
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 * U.widget_unit;
rad = wcol->roundness * BLI_rcti_size_y(rect);
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 * U.widget_unit;
rad = wcol->roundness * BLI_rcti_size_y(&recttemp);
round_box_edges(&wtb, UI_CNR_ALL, &recttemp, rad);
/* decoration */

View File

@@ -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.2f;
btheme->tui.wcol_option.roundness = 0.333333f;
btheme->tui.wcol_toggle.roundness = 0.25f;
btheme->tui.wcol_num.roundness = 0.5f;
btheme->tui.wcol_numslider.roundness = 0.5f;