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>2010-06-17 18:22:54 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-06-17 18:22:54 +0400
commit1cb7dc55b40ab5270502ac76ed81887bc227ae02 (patch)
tree458509650109dc5a15017fd22cffdcb51fa2ca94 /source/blender/blenlib/intern/rct.c
parenta7386bf9862a8d2960931c9d6df21549473adeec (diff)
sequencer numpad keys for zoom levels
Diffstat (limited to 'source/blender/blenlib/intern/rct.c')
-rw-r--r--source/blender/blenlib/intern/rct.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c
index 7fce9ac7e8d..5466acdba9f 100644
--- a/source/blender/blenlib/intern/rct.c
+++ b/source/blender/blenlib/intern/rct.c
@@ -142,6 +142,27 @@ void BLI_translate_rctf(rctf *rect, float x, float y)
rect->ymax += y;
}
+/* change width & height around the central location */
+void BLI_resize_rcti(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 -= x / 2;
+ rect->ymin -= y / 2;
+ rect->xmax= rect->xmin + x;
+ rect->ymax= rect->ymin + y;
+}
+
+void BLI_resize_rctf(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 -= x * 0.5f;
+ rect->ymin -= y * 0.5f;
+ rect->xmax= rect->xmin + x;
+ rect->ymax= rect->ymin + y;
+}
+
int BLI_isect_rctf(rctf *src1, rctf *src2, rctf *dest)
{
float xmin, xmax;