diff options
Diffstat (limited to 'source/blender/blenlib/intern/rct.c')
-rw-r--r-- | source/blender/blenlib/intern/rct.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c index 9c65c26c72b..61408610520 100644 --- a/source/blender/blenlib/intern/rct.c +++ b/source/blender/blenlib/intern/rct.c @@ -252,8 +252,8 @@ void BLI_rctf_translate(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 = (rect->xmax + rect->xmin) / 2; - rect->ymin = rect->ymax = (rect->ymax + rect->ymin) / 2; + rect->xmin = rect->xmax = BLI_RCT_CENTER_X(rect); + rect->ymin = rect->ymax = BLI_RCT_CENTER_Y(rect); rect->xmin -= x / 2; rect->ymin -= y / 2; rect->xmax = rect->xmin + x; @@ -262,8 +262,8 @@ void BLI_rcti_resize(rcti *rect, int x, int y) void BLI_rctf_resize(rctf *rect, float x, float y) { - rect->xmin = rect->xmax = (rect->xmax + rect->xmin) * 0.5f; - rect->ymin = rect->ymax = (rect->ymax + rect->ymin) * 0.5f; + rect->xmin = rect->xmax = BLI_RCT_CENTER_X(rect); + rect->ymin = rect->ymax = BLI_RCT_CENTER_Y(rect); rect->xmin -= x * 0.5f; rect->ymin -= y * 0.5f; rect->xmax = rect->xmin + x; |