[Bf-blender-cvs] [11644bf] ui-align-rework: Fix comparison between buttons (from review).

Bastien Montagne noreply at git.blender.org
Fri Nov 6 18:37:17 CET 2015


Commit: 11644bfa13f4af6a7030b7ef1e87a6097a77fe75
Author: Bastien Montagne
Date:   Fri Nov 6 18:21:16 2015 +0100
Branches: ui-align-rework
https://developer.blender.org/rB11644bfa13f4af6a7030b7ef1e87a6097a77fe75

Fix comparison between buttons (from review).

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

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

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

diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 8429523..f988114 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -3213,12 +3213,12 @@ static int ui_block_align_butal_cmp(const void *a, const void *b)
 	/* Sort vertically.
 	 * Note that Y of buttons is decreasing (first buttons have higher Y value than later ones). */
 	if (*butal->borders[TOP] != *butal_other->borders[TOP]) {
-		return *butal_other->borders[TOP] - *butal->borders[TOP];
+		return (*butal_other->borders[TOP] > *butal->borders[TOP]) ? 1 : -1;
 	}
 
 	/* Sort horizontally. */
 	if (*butal->borders[LEFT] != *butal_other->borders[LEFT]) {
-		return *butal->borders[LEFT] - *butal_other->borders[LEFT];
+		return (*butal->borders[LEFT] > *butal_other->borders[LEFT]) ? 1 : -1;
 	}
 
 	BLI_assert(0);




More information about the Bf-blender-cvs mailing list