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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-04-08 08:48:34 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-04-08 08:48:34 +0400
commitfca2058924177b25be05ea7829d07b3953302eda (patch)
treee36e09b9fb7e402d96f774dc487b7b9ed5e51ee8 /source
parentfcf137dbd7f31a22657a9fb5c460ee599bff4853 (diff)
fix [#34903] Lock Camera to View allows Numpad orbit, but not Numpad pan
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 3767f3011ff..ad68eefe340 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -3466,8 +3466,10 @@ static EnumPropertyItem prop_view_pan_items[] = {
static int viewpan_exec(bContext *C, wmOperator *op)
{
ARegion *ar = CTX_wm_region(C);
+ View3D *v3d = CTX_wm_view3d(C);
RegionView3D *rv3d = CTX_wm_region_view3d(C);
float vec[3];
+ float ofs[3];
const float co_zero[3] = {0.0f};
float mval_f[2] = {0.0f, 0.0f};
float zfac;
@@ -3475,18 +3477,17 @@ static int viewpan_exec(bContext *C, wmOperator *op)
pandir = RNA_enum_get(op->ptr, "type");
+ ED_view3d_camera_lock_init(v3d, rv3d);
+
zfac = ED_view3d_calc_zfac(rv3d, co_zero, NULL);
if (pandir == V3D_VIEW_PANRIGHT) { mval_f[0] = -32.0f; }
else if (pandir == V3D_VIEW_PANLEFT) { mval_f[0] = 32.0f; }
else if (pandir == V3D_VIEW_PANUP) { mval_f[1] = -25.0f; }
else if (pandir == V3D_VIEW_PANDOWN) { mval_f[1] = 25.0f; }
ED_view3d_win_to_delta(ar, mval_f, vec, zfac);
- add_v3_v3(rv3d->ofs, vec);
-
- if (rv3d->viewlock & RV3D_BOXVIEW)
- view3d_boxview_sync(CTX_wm_area(C), ar);
+ add_v3_v3v3(ofs, rv3d->ofs, vec);
- ED_region_tag_redraw(ar);
+ view3d_smooth_view(C, v3d, ar, NULL, NULL, ofs, NULL, NULL, NULL);
return OPERATOR_FINISHED;
}