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:
authorCampbell Barton <ideasman42@gmail.com>2013-03-19 14:54:52 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-03-19 14:54:52 +0400
commitd466e1d3b4ac18495f2a1b80ff3f70c686f8e706 (patch)
tree930403d9effbc59c982684c2caaa00646e3c7408 /source/blender/blenlib/intern/rct.c
parent0f3515d4e2cdb4df68540e1dfd74b1dc9e1e821e (diff)
add BLI_rcti,f_recenter()
fix for uninitialized variable use in radial_control_get_properties() and bad cast in bpy api's foreach_parse_args()
Diffstat (limited to 'source/blender/blenlib/intern/rct.c')
-rw-r--r--source/blender/blenlib/intern/rct.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c
index 127855161c0..91fcb5a5b83 100644
--- a/source/blender/blenlib/intern/rct.c
+++ b/source/blender/blenlib/intern/rct.c
@@ -296,6 +296,19 @@ void BLI_rctf_translate(rctf *rect, float x, float y)
rect->ymax += y;
}
+void BLI_rcti_recenter(rcti *rect, int x, int y)
+{
+ const int dx = x - BLI_rcti_cent_x(rect);
+ const int dy = y - BLI_rcti_cent_y(rect);
+ BLI_rcti_translate(rect, dx, dy);
+}
+void BLI_rctf_recenter(rctf *rect, float x, float y)
+{
+ const float dx = x - BLI_rctf_cent_x(rect);
+ const float dy = y - BLI_rctf_cent_y(rect);
+ BLI_rctf_translate(rect, dx, dy);
+}
+
/* change width & height around the central location */
void BLI_rcti_resize(rcti *rect, int x, int y)
{