[Bf-blender-cvs] [ab17792] ui-align-rework: Some more checks & tests, found out were is the cullprit of the off-by-one alignements of stitched-but-not-aligned buttons on top and left sides, due to correction applied in widget_roundbox_set().

Bastien Montagne noreply at git.blender.org
Thu Oct 22 16:32:25 CEST 2015


Commit: ab177926f8d4b16b4c3fe9cb9436700ff45faa24
Author: Bastien Montagne
Date:   Thu Oct 22 09:51:50 2015 +0200
Branches: ui-align-rework
https://developer.blender.org/rBab177926f8d4b16b4c3fe9cb9436700ff45faa24

Some more checks & tests, found out were is the cullprit of the off-by-one alignements
of stitched-but-not-aligned buttons on top and left sides, due to correction applied in widget_roundbox_set().

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

M	release/scripts/startup/bl_ui/properties_render.py
M	source/blender/editors/interface/interface.c
M	source/blender/editors/interface/interface_widgets.c

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

diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py
index a59c77c..77b77e8 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -187,7 +187,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
         sub.prop(rd, "resolution_y", text="Y")
         sub.label("")
         sub = col_a.row(align=True)
-        sub.prop(rd, "resolution_percentage", text="")
+        sub.prop(scene, "frame_end")
         sub.prop(scene, "frame_step")
 
 
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 019a939..b31e3a8 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1252,8 +1252,8 @@ void UI_block_end_ex(const bContext *C, uiBlock *block, const int xy[2])
 		UI_block_layout_resolve(block, NULL, NULL);
 	}
 
-	TIMEIT_BENCH(ui_block_align_calc(block), ui_block_align_calc);
-//	ui_block_align_calc(block);
+//	TIMEIT_BENCH(ui_block_align_calc(block), ui_block_align_calc);
+	ui_block_align_calc(block);
 
 	if ((block->flag & UI_BLOCK_LOOP) && (block->flag & UI_BLOCK_NUMSELECT)) {
 		ui_menu_block_set_keyaccels(block); /* could use a different flag to check */
@@ -3130,10 +3130,6 @@ static void block_align_stitch_neighbors(
 	       (butal = butal->neighbors[side_s1]) &&
 	       (butal->flags[side] & stitch_s2))
 	{
-//		printf("\t%s\n", butal->but->str[0] ? butal->but->str : "<noname>");
-//		if (STREQ(butal->but->str, "Frame Step: ")) {
-//			printf("%s: main side %d, stride side %d: %f (%f vs %f, %f)\n", butal->but->str, i, i_s1, butal->dists[i], co, *butal->borders[i], *butal->borders[i_opp]);
-//		}
 		butal_neighbor = butal->neighbors[side];
 
 		/* If we actually do have a neighbor, we directly set its values accordingly, and clear its matching 'dist'
@@ -3149,6 +3145,18 @@ static void block_align_stitch_neighbors(
 		/* Clearing one of the 'flags pair' here should be enough to prevent this loop running on
 		 * the same column, side and direction again. */
 		butal->flags[side] &= ~stitch_s2;
+
+//		printf("\t%s\n", butal->but->str[0] ? butal->but->str : "<noname>");
+//		if (STREQ(butal->but->str, "Frame Step: ")) {
+//			printf("\t\t%s: main side %d, stride side %d: %f (%f vs %f, %f)\n",
+//			       butal->but->str, side, side_s1, butal->dists[side], co,
+//			       *butal->borders[side], *butal->borders[side_opp]);
+//		}
+//		else if (butal_neighbor && STREQ(butal_neighbor->but->str, "Frame Step: ")) {
+//			printf("\t\t%s (neighbor): main side %d, stride side %d: %f (%f vs %f, %f)\n",
+//			       butal_neighbor->but->str, side, side_s1, butal_neighbor->dists[side], co,
+//			       *butal_neighbor->borders[side], *butal_neighbor->borders[side_opp]);
+//		}
 	}
 //	printf("\n");
 }
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 5d37f5c..38cb71a 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -3546,7 +3546,7 @@ static int widget_roundbox_set(uiBut *but, rcti *rect)
 
 	/* alignment */
 	if ((but->drawflag & UI_BUT_ALIGN) && but->type != UI_BTYPE_PULLDOWN) {
-		
+
 		/* ui_block_position has this correction too, keep in sync */
 		if (but->drawflag & UI_BUT_ALIGN_TOP)
 			rect->ymax += U.pixelsize;




More information about the Bf-blender-cvs mailing list