diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-08-29 12:38:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-08-29 12:38:01 +0300 |
commit | 6b8132a153d0bad697005d1d93c9827c2be8a273 (patch) | |
tree | fc8b8620807dd61ace254192b2bd969b7e5d4bbf /source/blender/editors/interface/view2d.c | |
parent | 3d56bfbc8252dd371853f4a34eb29a67cd29337f (diff) | |
parent | c7f106cbe22e0cf000a35dda7adff7d596843cc5 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/interface/view2d.c')
-rw-r--r-- | source/blender/editors/interface/view2d.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index fb57902d258..53cc6607b2e 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -2260,6 +2260,14 @@ void UI_view2d_view_to_region_rcti(View2D *v2d, const rctf *rect_src, rcti *rect clamp_rctf_to_rcti(rect_dst, &rect_tmp); } +void UI_view2d_view_to_region_m4(View2D *v2d, float matrix[4][4]) +{ + rctf mask; + unit_m4(matrix); + BLI_rctf_rcti_copy(&mask, &v2d->mask); + BLI_rctf_transform_calc_m4_pivot_min(&v2d->cur, &mask, matrix); +} + bool UI_view2d_view_to_region_rcti_clip(View2D *v2d, const rctf *rect_src, rcti *rect_dst) { const float cur_size[2] = {BLI_rctf_size_x(&v2d->cur), BLI_rctf_size_y(&v2d->cur)}; |