diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-19 03:15:11 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-19 03:15:11 +0400 |
commit | 26e08e1b9d53bc9ea5e3845336eb07e38d6bdc99 (patch) | |
tree | 9e49742b233ffc95a68fce8d1d56526dcc80c0a6 /source/blender/blenkernel | |
parent | 4d31654a617ed5dd49792361e8c1102df25ab563 (diff) |
Camera Sensor:
* Tweak description of sensor fit property.
* Fix sensor display for auto and vertical fit.
* Fix incorrect aspect ratio for camera frame drawing.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/camera.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c index 29770e37ea1..a8b1c2aa04f 100644 --- a/source/blender/blenkernel/intern/camera.c +++ b/source/blender/blenkernel/intern/camera.c @@ -364,25 +364,16 @@ void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const sh if (scene) { float aspx= (float) scene->r.xsch*scene->r.xasp; float aspy= (float) scene->r.ysch*scene->r.yasp; + int sensor_fit= camera_sensor_fit(camera->sensor_fit, aspx, aspy); - if(camera->sensor_fit==CAMERA_SENSOR_FIT_AUTO) { - if(aspx < aspy) { - r_asp[0]= aspx / aspy; - r_asp[1]= 1.0; - } - else { - r_asp[0]= 1.0; - r_asp[1]= aspy / aspx; - } + if(sensor_fit==CAMERA_SENSOR_FIT_HOR) { + r_asp[0]= 1.0; + r_asp[1]= aspy / aspx; } - else if(camera->sensor_fit==CAMERA_SENSOR_FIT_HOR) { + else { r_asp[0]= aspx / aspy; r_asp[1]= 1.0; } - else { - r_asp[0]= 1.0; - r_asp[1]= aspy / aspx; - } } else { r_asp[0]= 1.0f; |