[Bf-blender-cvs] [9123977] master: Fix T44432: Zoom to mouse fails /w FCurve editor

Campbell Barton noreply at git.blender.org
Tue Apr 21 05:11:59 CEST 2015


Commit: 912397756a8adfde91e2c307ab9f17d873e002f8
Author: Campbell Barton
Date:   Tue Apr 21 13:10:32 2015 +1000
Branches: master
https://developer.blender.org/rB912397756a8adfde91e2c307ab9f17d873e002f8

Fix T44432: Zoom to mouse fails /w FCurve editor

===================================================================

M	source/blender/editors/interface/view2d_ops.c
M	source/blender/makesdna/DNA_view2d_types.h

===================================================================

diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 5730c96..58b51ef 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -661,7 +661,9 @@ static void view_zoomstep_apply_ex(bContext *C, v2dViewZoomData *vzd, const bool
 				const float zoomx = (float)(BLI_rcti_size_x(&v2d->mask) + 1) / BLI_rctf_size_x(&v2d->cur);
 
 				/* only move view to mouse if zoom fac is inside minzoom/maxzoom */
-				if (IN_RANGE_INCL(zoomx, v2d->minzoom, v2d->maxzoom)) {
+				if (((v2d->keepzoom & V2D_LIMITZOOM) == 0) ||
+				    IN_RANGE_INCL(zoomx, v2d->minzoom, v2d->maxzoom))
+				{
 					float mval_fac = (vzd->mx_2d - cur_old.xmin) / BLI_rctf_size_x(&cur_old);
 					float mval_faci = 1.0f - mval_fac;
 					float ofs = (mval_fac * dx) - (mval_faci * dx);
@@ -692,7 +694,9 @@ static void view_zoomstep_apply_ex(bContext *C, v2dViewZoomData *vzd, const bool
 				const float zoomy = (float)(BLI_rcti_size_y(&v2d->mask) + 1) / BLI_rctf_size_y(&v2d->cur);
 
 				/* only move view to mouse if zoom fac is inside minzoom/maxzoom */
-				if (IN_RANGE_INCL(zoomy, v2d->minzoom, v2d->maxzoom)) {
+				if (((v2d->keepzoom & V2D_LIMITZOOM) == 0) ||
+				    IN_RANGE_INCL(zoomy, v2d->minzoom, v2d->maxzoom))
+				{
 					float mval_fac = (vzd->my_2d - cur_old.ymin) / BLI_rctf_size_y(&cur_old);
 					float mval_faci = 1.0f - mval_fac;
 					float ofs = (mval_fac * dy) - (mval_faci * dy);
diff --git a/source/blender/makesdna/DNA_view2d_types.h b/source/blender/makesdna/DNA_view2d_types.h
index a7921be..6f2e347 100644
--- a/source/blender/makesdna/DNA_view2d_types.h
+++ b/source/blender/makesdna/DNA_view2d_types.h
@@ -43,7 +43,7 @@ typedef struct View2D {
 	rcti mask;						/* mask - region (in screenspace) within which 'cur' can be viewed */
 	
 	float min[2], max[2];			/* min/max sizes of 'cur' rect (only when keepzoom not set) */
-	float minzoom, maxzoom;			/* self explanatory. allowable zoom factor range (only when keepzoom set) */
+	float minzoom, maxzoom;			/* allowable zoom factor range (only when (keepzoom & V2D_LIMITZOOM)) is set */
 	
 	short scroll;					/* scroll - scrollbars to display (bitflag) */
 	short scroll_ui;				/* scroll_ui - temp settings used for UI drawing of scrollers */




More information about the Bf-blender-cvs mailing list