From 3cee9d6939c85afd7eabf9fafbcec7859abef9a0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 25 Mar 2015 20:28:17 +1100 Subject: Simplify recent commit --- source/blender/blenlib/intern/rct.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c index d7ca749b600..1edc9002611 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])); -- cgit v1.2.3