[Bf-blender-cvs] [3cee9d6] master: Simplify recent commit

Campbell Barton noreply at git.blender.org
Wed Mar 25 10:29:55 CET 2015


Commit: 3cee9d6939c85afd7eabf9fafbcec7859abef9a0
Author: Campbell Barton
Date:   Wed Mar 25 20:28:17 2015 +1100
Branches: master
https://developer.blender.org/rB3cee9d6939c85afd7eabf9fafbcec7859abef9a0

Simplify recent commit

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

M	source/blender/blenlib/intern/rct.c

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

diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c
index d7ca749..1edc900 100644
--- a/source/blender/blenlib/intern/rct.c
+++ b/source/blender/blenlib/intern/rct.c
@@ -593,12 +593,14 @@ void BLI_rctf_rotate_expand(rctf *dst, const rctf *src, const float angle)
 	const float cent[2] = {BLI_rctf_cent_x(src), BLI_rctf_cent_y(src)};
 	float corner[2], corner_rot[2], corder_max[2];
 
-	ARRAY_SET_ITEMS(corner, src->xmin - cent[0], src->ymax - cent[1]);
+	/* x is same for both corners */
+	corner[0] = src->xmax - cent[0];
+	corner[1] = src->ymax - cent[1];
 	ROTATE_SINCOS(corner_rot, mat2, corner);
 	corder_max[0] = fabsf(corner_rot[0]);
 	corder_max[1] = fabsf(corner_rot[1]);
 
-	ARRAY_SET_ITEMS(corner, src->xmax - cent[0], src->ymax - cent[1]);
+	corner[1] *= -1;
 	ROTATE_SINCOS(corner_rot, mat2, corner);
 	corder_max[0] = MAX2(corder_max[0], fabsf(corner_rot[0]));
 	corder_max[1] = MAX2(corder_max[1], fabsf(corner_rot[1]));




More information about the Bf-blender-cvs mailing list