diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-25 12:31:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-25 12:31:52 +0400 |
commit | 81d5e4f8dfe4d4d6bffd719006da96167383a743 (patch) | |
tree | 2df47453889e6cd885319c173e1d272ce8ccec66 /source/blender/blenlib/intern/rct.c | |
parent | 0066e337683c9b78ff3a62e1caed004d07fe4803 (diff) |
bugfix [#22819] Grease Pencil: OpenGL render incorrect if view mode, OK with cursor mode
also made drawing in camera view stick to the camera border (belated durian request),
useful for animation review without worrying about screensize moving the overlay about.
Diffstat (limited to 'source/blender/blenlib/intern/rct.c')
-rw-r--r-- | source/blender/blenlib/intern/rct.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c index 5466acdba9f..aa424c1c2bb 100644 --- a/source/blender/blenlib/intern/rct.c +++ b/source/blender/blenlib/intern/rct.c @@ -36,6 +36,8 @@ */ #include "DNA_vec_types.h" +#include <stdio.h> +#include <math.h> int BLI_rcti_is_empty(rcti * rect) { @@ -222,3 +224,21 @@ int BLI_isect_rcti(rcti *src1, rcti *src2, rcti *dest) return 0; } } + +void BLI_copy_rcti_rctf(rcti *tar, const rctf *src) +{ + tar->xmin= floor(src->xmin + 0.5); + tar->xmax= floor((src->xmax - src->xmin) + 0.5); + tar->ymin= floor(src->ymin + 0.5); + tar->ymax= floor((src->ymax - src->ymin) + 0.5); +} + +void print_rctf(const char *str, rctf *rect) +{ + printf("%s: xmin %.3f, xmax %.3f, ymin %.3f, ymax %.3f\n", str, rect->xmin, rect->xmax, rect->ymin, rect->ymax); +} + +void print_rcti(const char *str, rcti *rect) +{ + printf("%s: xmin %d, xmax %d, ymin %d, ymax %d\n", str, rect->xmin, rect->xmax, rect->ymin, rect->ymax); +} |