From d666b4fae57b5b395e48e043c2a4bb4b4ecf8723 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 27 Oct 2010 11:05:46 +0000 Subject: fix for shift offset in own recent commit for drawing the camera border in camera view. --- source/blender/editors/space_view3d/view3d_view.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index aac03d97022..6cbce905f33 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1022,9 +1022,15 @@ int get_view3d_viewplane(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi, float dx= 0.5*fac*rv3d->camdx*(x2-x1); float dy= 0.5*fac*rv3d->camdy*(y2-y1); - /* shify offset */ - dx += ((cam->shiftx/10.0f) / cam->lens) * 32.0; - dy += ((cam->shifty/10.0f) / cam->lens) * 32.0; + /* shift offset */ + if(cam->type==CAM_ORTHO) { + dx += cam->shiftx * cam->ortho_scale; + dy += cam->shifty * cam->ortho_scale; + } + else { + dx += cam->shiftx * (cam->clipsta / cam->lens) * 32.0; + dy += cam->shifty * (cam->clipsta / cam->lens) * 32.0; + } x1+= dx; x2+= dx; -- cgit v1.2.3