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-09-11 08:39:00 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-09-11 08:39:00 +0400
commitb2b08692124cac0571e40f8bbf2b92fde857e8b9 (patch)
treeba53ed3a09b10fd5ae0faa572a7b5b74316e9d7f /source/blender/editors/space_view3d/view3d_edit.c
parent63a8056839b0b43c4e2a0f24ca894ea7912ab234 (diff)
- camera max zoom limit was inconsistent
- camera pan now follows the mouse
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_edit.c')
-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 3614717e9e0..e2c12386dd3 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -854,10 +854,11 @@ void viewmove_modal_keymap(wmKeyConfig *keyconf)
static void viewmove_apply(ViewOpsData *vod, int x, int y)
{
if(vod->rv3d->persp==RV3D_CAMOB) {
- float max= (float)MAX2(vod->ar->winx, vod->ar->winy);
+ float zoomfac= (M_SQRT2 + vod->rv3d->camzoom/50.0);
+ zoomfac= (zoomfac*zoomfac)*0.5;
- vod->rv3d->camdx += (vod->oldx - x)/(max);
- vod->rv3d->camdy += (vod->oldy - y)/(max);
+ vod->rv3d->camdx += (vod->oldx - x)/(vod->ar->winx * zoomfac);
+ vod->rv3d->camdy += (vod->oldy - y)/(vod->ar->winy * zoomfac);
CLAMP(vod->rv3d->camdx, -1.0f, 1.0f);
CLAMP(vod->rv3d->camdy, -1.0f, 1.0f);
// XXX preview3d_event= 0;
@@ -1165,7 +1166,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
/* this min and max is also in viewmove() */
if(rv3d->persp==RV3D_CAMOB) {
rv3d->camzoom-= 10;
- if(rv3d->camzoom<-30) rv3d->camzoom= -30;
+ if(rv3d->camzoom < RV3D_CAMZOOM_MIN) rv3d->camzoom= RV3D_CAMZOOM_MIN;
}
else if(rv3d->dist<10.0*v3d->far) {
view_zoom_mouseloc(CTX_wm_region(C), 1.2f, mx, my);
@@ -1174,7 +1175,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
else {
if(rv3d->persp==RV3D_CAMOB) {
rv3d->camzoom+= 10;
- if(rv3d->camzoom>600) rv3d->camzoom= 600;
+ if(rv3d->camzoom > RV3D_CAMZOOM_MAX) rv3d->camzoom= RV3D_CAMZOOM_MAX;
}
else if(rv3d->dist> 0.001*v3d->grid) {
view_zoom_mouseloc(CTX_wm_region(C), .83333f, mx, my);