Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/intern/rct.c')
-rw-r--r--source/blender/blenlib/intern/rct.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c
index f952b62cb61..61e0ec393cb 100644
--- a/source/blender/blenlib/intern/rct.c
+++ b/source/blender/blenlib/intern/rct.c
@@ -623,6 +623,18 @@ void BLI_rctf_recenter(rctf *rect, float x, float y)
}
/* change width & height around the central location */
+void BLI_rcti_resize_x(rcti *rect, int x)
+{
+ rect->xmin = BLI_rcti_cent_x(rect) - (x / 2);
+ rect->xmax = rect->xmin + x;
+}
+
+void BLI_rcti_resize_y(rcti *rect, int y)
+{
+ rect->ymin = BLI_rcti_cent_y(rect) - (y / 2);
+ rect->ymax = rect->ymin + y;
+}
+
void BLI_rcti_resize(rcti *rect, int x, int y)
{
rect->xmin = BLI_rcti_cent_x(rect) - (x / 2);
@@ -639,6 +651,18 @@ void BLI_rcti_pad(rcti *rect, int pad_x, int pad_y)
rect->ymax += pad_y;
}
+void BLI_rctf_resize_x(rctf *rect, float x)
+{
+ rect->xmin = BLI_rctf_cent_x(rect) - (x * 0.5f);
+ rect->xmax = rect->xmin + x;
+}
+
+void BLI_rctf_resize_y(rctf *rect, float y)
+{
+ rect->ymin = BLI_rctf_cent_y(rect) - (y * 0.5f);
+ rect->ymax = rect->ymin + y;
+}
+
void BLI_rctf_resize(rctf *rect, float x, float y)
{
rect->xmin = BLI_rctf_cent_x(rect) - (x * 0.5f);
@@ -1061,9 +1085,9 @@ void print_rcti(const char *str, const rcti *rect)
BLI_rcti_size_y(rect));
}
-/* -------------------------------------------------------------------- */
/* Comprehensive math (float only) */
+/* -------------------------------------------------------------------- */
/** \name Rect math functions
* \{ */