[Bf-blender-cvs] [bf53615] master: Fix View3D glitch zooming
Campbell Barton
noreply at git.blender.org
Mon Aug 25 06:21:17 CEST 2014
Commit: bf5361591dd6f44f3e275615425bbe8838f976c6
Author: Campbell Barton
Date: Mon Aug 25 14:16:12 2014 +1000
Branches: master
https://developer.blender.org/rBbf5361591dd6f44f3e275615425bbe8838f976c6
Fix View3D glitch zooming
Fast cursor movement could clamp the distance incorrectly.
===================================================================
M source/blender/editors/space_view3d/view3d_edit.c
===================================================================
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 23d47f1..4104591 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -2187,10 +2187,14 @@ static void viewzoom_apply(ViewOpsData *vod, const int xy[2], const short viewzo
}
if (!use_cam_zoom) {
- if (zfac != 1.0f && zfac * vod->rv3d->dist > 0.001f * vod->grid &&
- zfac * vod->rv3d->dist < 10.0f * vod->far)
- {
- view_zoom_mouseloc(vod->ar, zfac, vod->oldx, vod->oldy);
+ if (zfac != 1.0f) {
+ const float zfac_min = dist_range[0] / vod->rv3d->dist;
+ const float zfac_max = dist_range[1] / vod->rv3d->dist;
+ CLAMP(zfac, zfac_min, zfac_max);
+
+ if (zfac != 1.0f) {
+ view_zoom_mouseloc(vod->ar, zfac, vod->oldx, vod->oldy);
+ }
}
}
More information about the Bf-blender-cvs
mailing list