Cleanup: redundant assignment in rect resize
This commit is contained in:
@@ -420,20 +420,16 @@ void BLI_rctf_recenter(rctf *rect, float x, float y)
|
|||||||
/* change width & height around the central location */
|
/* change width & height around the central location */
|
||||||
void BLI_rcti_resize(rcti *rect, int x, int y)
|
void BLI_rcti_resize(rcti *rect, int x, int y)
|
||||||
{
|
{
|
||||||
rect->xmin = rect->xmax = BLI_rcti_cent_x(rect);
|
rect->xmin = BLI_rcti_cent_x(rect) - (x / 2);
|
||||||
rect->ymin = rect->ymax = BLI_rcti_cent_y(rect);
|
rect->ymin = BLI_rcti_cent_y(rect) - (y / 2);
|
||||||
rect->xmin -= x / 2;
|
|
||||||
rect->ymin -= y / 2;
|
|
||||||
rect->xmax = rect->xmin + x;
|
rect->xmax = rect->xmin + x;
|
||||||
rect->ymax = rect->ymin + y;
|
rect->ymax = rect->ymin + y;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BLI_rctf_resize(rctf *rect, float x, float y)
|
void BLI_rctf_resize(rctf *rect, float x, float y)
|
||||||
{
|
{
|
||||||
rect->xmin = rect->xmax = BLI_rctf_cent_x(rect);
|
rect->xmin = BLI_rctf_cent_x(rect) - (x * 0.5f);
|
||||||
rect->ymin = rect->ymax = BLI_rctf_cent_y(rect);
|
rect->ymin = BLI_rctf_cent_y(rect) - (y * 0.5f);
|
||||||
rect->xmin -= x * 0.5f;
|
|
||||||
rect->ymin -= y * 0.5f;
|
|
||||||
rect->xmax = rect->xmin + x;
|
rect->xmax = rect->xmin + x;
|
||||||
rect->ymax = rect->ymin + y;
|
rect->ymax = rect->ymin + y;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user