fix [#27839] UV 'Project from view' ignores camera lens shift
authorCampbell Barton <ideasman42@gmail.com>
Sun, 3 Jul 2011 07:37:33 +0000 (07:37 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 3 Jul 2011 07:37:33 +0000 (07:37 +0000)
source/blender/blenlib/intern/uvproject.c

index d139fb1ab71b283a0432d66eaf7e88f229a6aacb..ecb42315ee3a4c33a3007dad76138784915fdcf7 100644 (file)
@@ -169,8 +169,8 @@ UvCameraInfo *project_camera_info(Object *ob, float (*rotmat)[4], float winx, fl
                }
                
                /* include 0.5f here to move the UVs into the center */
-               uci.shiftx = 0.5f - camera->shiftx;
-               uci.shifty = 0.5f - camera->shifty;
+               uci.shiftx = 0.5f - (camera->shiftx * uci.xasp);
+               uci.shifty = 0.5f - (camera->shifty * uci.yasp);
                
                uci_pt= MEM_mallocN(sizeof(UvCameraInfo), "UvCameraInfo");
                *uci_pt= uci;