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>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/blenlib/BLI_rect.h
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/blenlib/BLI_rect.h')
-rw-r--r--source/blender/blenlib/BLI_rect.h67
1 files changed, 52 insertions, 15 deletions
diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h
index a8d1df8eeb8..f73f2e6706e 100644
--- a/source/blender/blenlib/BLI_rect.h
+++ b/source/blender/blenlib/BLI_rect.h
@@ -25,7 +25,7 @@
*/
#include "DNA_vec_types.h"
-#include "BLI_sys_types.h" /* bool */
+#include "BLI_sys_types.h" /* bool */
#include "BLI_compiler_compat.h"
struct rctf;
@@ -46,8 +46,12 @@ void BLI_rctf_init_minmax(struct rctf *rect);
void BLI_rcti_do_minmax_v(struct rcti *rect, const int xy[2]);
void BLI_rctf_do_minmax_v(struct rctf *rect, const float xy[2]);
-void BLI_rctf_transform_pt_v(const rctf *dst, const rctf *src, float xy_dst[2], const float xy_src[2]);
-void BLI_rctf_transform_calc_m4_pivot_min_ex(const rctf *dst, const rctf *src, float matrix[4][4], uint x, uint y);
+void BLI_rctf_transform_pt_v(const rctf *dst,
+ const rctf *src,
+ float xy_dst[2],
+ const float xy_src[2]);
+void BLI_rctf_transform_calc_m4_pivot_min_ex(
+ const rctf *dst, const rctf *src, float matrix[4][4], uint x, uint y);
void BLI_rctf_transform_calc_m4_pivot_min(const rctf *dst, const rctf *src, float matrix[4][4]);
void BLI_rctf_translate(struct rctf *rect, float x, float y);
@@ -58,7 +62,10 @@ void BLI_rcti_resize(struct rcti *rect, int x, int y);
void BLI_rctf_resize(struct rctf *rect, float x, float y);
void BLI_rcti_scale(rcti *rect, const float scale);
void BLI_rctf_scale(rctf *rect, const float scale);
-void BLI_rctf_interp(struct rctf *rect, const struct rctf *rect_a, const struct rctf *rect_b, const float fac);
+void BLI_rctf_interp(struct rctf *rect,
+ const struct rctf *rect_a,
+ const struct rctf *rect_b,
+ const float fac);
//void BLI_rcti_interp(struct rctf *rect, struct rctf *rect_a, struct rctf *rect_b, float fac);
bool BLI_rctf_clamp_pt_v(const struct rctf *rect, float xy[2]);
bool BLI_rcti_clamp_pt_v(const struct rcti *rect, int xy[2]);
@@ -101,20 +108,50 @@ void print_rcti(const char *str, const struct rcti *rect);
#define print_rctf_id(rect) print_rctf(STRINGIFY(rect), rect)
#define print_rcti_id(rect) print_rcti(STRINGIFY(rect), rect)
-BLI_INLINE float BLI_rcti_cent_x_fl(const struct rcti *rct) { return (float)(rct->xmin + rct->xmax) / 2.0f; }
-BLI_INLINE float BLI_rcti_cent_y_fl(const struct rcti *rct) { return (float)(rct->ymin + rct->ymax) / 2.0f; }
-BLI_INLINE int BLI_rcti_cent_x(const struct rcti *rct) { return (rct->xmin + rct->xmax) / 2; }
-BLI_INLINE int BLI_rcti_cent_y(const struct rcti *rct) { return (rct->ymin + rct->ymax) / 2; }
-BLI_INLINE float BLI_rctf_cent_x(const struct rctf *rct) { return (rct->xmin + rct->xmax) / 2.0f; }
-BLI_INLINE float BLI_rctf_cent_y(const struct rctf *rct) { return (rct->ymin + rct->ymax) / 2.0f; }
+BLI_INLINE float BLI_rcti_cent_x_fl(const struct rcti *rct)
+{
+ return (float)(rct->xmin + rct->xmax) / 2.0f;
+}
+BLI_INLINE float BLI_rcti_cent_y_fl(const struct rcti *rct)
+{
+ return (float)(rct->ymin + rct->ymax) / 2.0f;
+}
+BLI_INLINE int BLI_rcti_cent_x(const struct rcti *rct)
+{
+ return (rct->xmin + rct->xmax) / 2;
+}
+BLI_INLINE int BLI_rcti_cent_y(const struct rcti *rct)
+{
+ return (rct->ymin + rct->ymax) / 2;
+}
+BLI_INLINE float BLI_rctf_cent_x(const struct rctf *rct)
+{
+ return (rct->xmin + rct->xmax) / 2.0f;
+}
+BLI_INLINE float BLI_rctf_cent_y(const struct rctf *rct)
+{
+ return (rct->ymin + rct->ymax) / 2.0f;
+}
-BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct) { return (rct->xmax - rct->xmin); }
-BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct) { return (rct->ymax - rct->ymin); }
-BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct) { return (rct->xmax - rct->xmin); }
-BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct) { return (rct->ymax - rct->ymin); }
+BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
+{
+ return (rct->xmax - rct->xmin);
+}
+BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
+{
+ return (rct->ymax - rct->ymin);
+}
+BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
+{
+ return (rct->xmax - rct->xmin);
+}
+BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
+{
+ return (rct->ymax - rct->ymin);
+}
#ifdef __cplusplus
}
#endif
-#endif /* __BLI_RECT_H__ */
+#endif /* __BLI_RECT_H__ */