[Bf-blender-cvs] [a9d3f9f54d6] blender2.8: Revert "UI: fix inconsistency in button rounding when zooming in."

Brecht Van Lommel noreply at git.blender.org
Wed Apr 25 15:49:05 CEST 2018


Commit: a9d3f9f54d6db8197b891ba4bdcc53bf6adeb113
Author: Brecht Van Lommel
Date:   Wed Apr 25 11:53:21 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBa9d3f9f54d6db8197b891ba4bdcc53bf6adeb113

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 1ba91ae2c02863b3fd97810e7bcee902dac58992.

===================================================================

M	source/blender/editors/interface/interface_widgets.c
M	source/blender/editors/interface/resources.c

===================================================================

diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index a3b4cbe392c..a9bb3089175 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.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 */
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 593d935e8f3..1bc834a121c 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.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;



More information about the Bf-blender-cvs mailing list