Fix T73847 Overlay: Camera orthographic scale moves background image

This commit is contained in:
Clément Foucault 2020-05-19 16:29:13 +02:00
parent 059f79bdd7
commit a4cbacacbf
Notes: blender-bot 2023-10-18 15:23:11 +02:00
Referenced by issue #73847, Changing camera orthographic scale moves background image
1 changed files with 3 additions and 0 deletions

View File

@ -287,6 +287,9 @@ static void image_camera_background_matrix_get(const Camera *cam,
translate[3][0] = bgpic->offset[0];
translate[3][1] = bgpic->offset[1];
translate[3][2] = cam_corners[0][2];
if (cam->type == CAM_ORTHO) {
mul_v2_fl(translate[3], cam->ortho_scale);
}
/* These lines are for keeping 2.80 behavior and could be removed to keep 2.79 behavior. */
translate[3][0] *= min_ff(1.0f, cam_aspect);
translate[3][1] /= max_ff(1.0f, cam_aspect) * (image_aspect / cam_aspect);