diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2022-06-28 08:51:19 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-06-28 08:54:02 +0300 |
commit | 33fc230ba2e93242f6862a8934a96c3f6619bcb8 (patch) | |
tree | de53f27d04485cd6e25b9341298c2a59526b7172 /source/blender | |
parent | e6d50cdd431fd56bc76699aeaab7ea840db1eb2d (diff) |
Fix T98799: camera unselectable in camera view below a certain scale
The camera frame (used for selection) was drawn outside the near
clipping plane in those cases.
This has been an issue before as seen in the following commits:
- rB6e7e6832e87
- rB33d322873e6
- rB4f9451c0442
Remaining issue was that the code which ensure the frame isn't behind
the near clipping plane was not taking into account the camera could be
scaled (in Z).
A caller of `BKE_camera_view_frame_ex` (namely
`OVERLAY_camera_cache_populate`) applies scale (also on the depth) which
does not play well with the way `BKE_camera_view_frame_ex` did it.
Now take Z scale into account.
Ref D15178
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/camera.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c index 6325251647b..fbe03ac365c 100644 --- a/source/blender/blenkernel/intern/camera.c +++ b/source/blender/blenkernel/intern/camera.c @@ -528,7 +528,7 @@ void BKE_camera_view_frame_ex(const Scene *scene, if (do_clip) { /* Ensure the frame isn't behind the near clipping plane, T62814. */ - float fac = (camera->clip_start + 0.1f) / -r_vec[0][2]; + float fac = ((camera->clip_start + 0.1f) / -r_vec[0][2]) * scale[2]; for (uint i = 0; i < 4; i++) { if (camera->type == CAM_ORTHO) { r_vec[i][2] *= fac; |