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 <campbell@blender.org>2022-02-18 08:43:10 +0300
committerCampbell Barton <campbell@blender.org>2022-02-18 08:48:27 +0300
commitf33e6e0d8c607eb33b1eb0c587b4e43cde30d5e1 (patch)
tree07cfc1e5610853f9370010da428023fc0d7eea4b /source/blender/editors/space_view3d/view3d_navigate.c
parentae9dd0cbf911662798e7dfb3120721d949f6cd40 (diff)
Cleanup: move camera-view pan/zoom into utility functions
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_navigate.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_navigate.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_navigate.c b/source/blender/editors/space_view3d/view3d_navigate.c
index 0305989d142..d1e7b5891e9 100644
--- a/source/blender/editors/space_view3d/view3d_navigate.c
+++ b/source/blender/editors/space_view3d/view3d_navigate.c
@@ -549,11 +549,11 @@ void viewmove_apply(ViewOpsData *vod, int x, int y)
vod->rv3d->ofs_lock[1] -= ((vod->prev.event_xy[1] - y) * 2.0f) / (float)vod->region->winy;
}
else if ((vod->rv3d->persp == RV3D_CAMOB) && !ED_view3d_camera_lock_check(vod->v3d, vod->rv3d)) {
- const float zoomfac = BKE_screen_view3d_zoom_to_fac(vod->rv3d->camzoom) * 2.0f;
- vod->rv3d->camdx += (vod->prev.event_xy[0] - x) / (vod->region->winx * zoomfac);
- vod->rv3d->camdy += (vod->prev.event_xy[1] - y) / (vod->region->winy * zoomfac);
- CLAMP(vod->rv3d->camdx, -1.0f, 1.0f);
- CLAMP(vod->rv3d->camdy, -1.0f, 1.0f);
+ const float event_ofs[2] = {
+ vod->prev.event_xy[0] - x,
+ vod->prev.event_xy[1] - y,
+ };
+ ED_view3d_camera_view_pan(vod->region, event_ofs);
}
else {
float dvec[3];