Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-10-27 15:05:46 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-10-27 15:05:46 +0400
commitd666b4fae57b5b395e48e043c2a4bb4b4ecf8723 (patch)
treec47b868fa1b274a002d7312c9bc9cdb0a9acb4de
parent2f0f25741063b236853e606952658261ec480daf (diff)
fix for shift offset in own recent commit for drawing the camera border in camera view.
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c12
1 files changed, 9 insertions, 3 deletions
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;