Commit: 32c65faeb94e86af82e6e9e71ef1539fef82709b
Author: Campbell Barton
Date:   Mon Jan 2 13:55:48 2017 +1100
Branches: master
https://developer.blender.org/rB32c65faeb94e86af82e6e9e71ef1539fef82709b

Cleanup: redundant assignment in rect resize

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

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

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

diff --git a/source/blender/blenlib/intern/rct.c 
b/source/blender/blenlib/intern/rct.c
index 9d5a463..ac73a98 100644
--- a/source/blender/blenlib/intern/rct.c
+++ b/source/blender/blenlib/intern/rct.c
@@ -420,20 +420,16 @@ void BLI_rctf_recenter(rctf *rect, float x, float y)
 /* change width & height around the central location */
 void BLI_rcti_resize(rcti *rect, int x, int y)
 {
-       rect->xmin = rect->xmax = BLI_rcti_cent_x(rect);
-       rect->ymin = rect->ymax = BLI_rcti_cent_y(rect);
-       rect->xmin -= x / 2;
-       rect->ymin -= y / 2;
+       rect->xmin = BLI_rcti_cent_x(rect) - (x / 2);
+       rect->ymin = BLI_rcti_cent_y(rect) - (y / 2);
        rect->xmax = rect->xmin + x;
        rect->ymax = rect->ymin + y;
 }
 
 void BLI_rctf_resize(rctf *rect, float x, float y)
 {
-       rect->xmin = rect->xmax = BLI_rctf_cent_x(rect);
-       rect->ymin = rect->ymax = BLI_rctf_cent_y(rect);
-       rect->xmin -= x * 0.5f;
-       rect->ymin -= y * 0.5f;
+       rect->xmin = BLI_rctf_cent_x(rect) - (x * 0.5f);
+       rect->ymin = BLI_rctf_cent_y(rect) - (y * 0.5f);
        rect->xmax = rect->xmin + x;
        rect->ymax = rect->ymin + y;
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to