diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-03-25 11:46:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-03-25 11:49:14 +0300 |
commit | 3eb33b804d48ac4009184722db02ecaa9d71ef21 (patch) | |
tree | 50e577605f85f7f062429568e3cfac782baa6137 /source/blender/editors/space_view3d/view3d_draw.c | |
parent | 8d0b104f4357f5914f3e28d735ebffa1526a598e (diff) |
Fix T44118: Rotated background image disappears
Image clipping didn't take rotation into account.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 86916a37d43..a06f6cd515b 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1624,6 +1624,7 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d, ImBuf *ibuf = NULL, *freeibuf, *releaseibuf; void *lock; + rctf clip_rect; Image *ima = NULL; MovieClip *clip = NULL; @@ -1786,8 +1787,12 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d, } /* complete clip? */ + BLI_rctf_init(&clip_rect, x1, x2, y1, y2); + if (bgpic->rotation) { + BLI_rctf_rotate_expand(&clip_rect, &clip_rect, bgpic->rotation); + } - if (x2 < 0 || y2 < 0 || x1 > ar->winx || y1 > ar->winy) { + if (clip_rect.xmax < 0 || clip_rect.ymax < 0 || clip_rect.xmin > ar->winx || clip_rect.ymin > ar->winy) { if (freeibuf) IMB_freeImBuf(freeibuf); if (releaseibuf) |