diff options
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/blender/blender_camera.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/intern/cycles/blender/blender_camera.cpp b/intern/cycles/blender/blender_camera.cpp index 16f555cb58c..dee9ee09fc6 100644 --- a/intern/cycles/blender/blender_camera.cpp +++ b/intern/cycles/blender/blender_camera.cpp @@ -623,10 +623,12 @@ BufferParams BlenderSync::get_buffer_params(BL::RenderSettings b_render, BL::Sce if(use_border) { /* border render */ - params.full_x = (int)(cam->border.left * (float)width); - params.full_y = (int)(cam->border.bottom * (float)height); - params.width = (int)(cam->border.right * (float)width) - params.full_x; - params.height = (int)(cam->border.top * (float)height) - params.full_y; + /* the viewport may offset the border outside the view */ + BoundBox2D border = cam->border.clamp(); + params.full_x = (int)(border.left * (float)width); + params.full_y = (int)(border.bottom * (float)height); + params.width = (int)(border.right * (float)width) - params.full_x; + params.height = (int)(border.top * (float)height) - params.full_y; /* survive in case border goes out of view or becomes too small */ params.width = max(params.width, 1); |