[Bf-blender-cvs] [477078d] master: Fix T45523: "View All" in Graph Editor does not respect Y axis with small values

Joshua Leung noreply at git.blender.org
Fri Jan 22 13:57:24 CET 2016


Commit: 477078defa0eab48db167a04c208782d1114525c
Author: Joshua Leung
Date:   Sat Jan 23 01:56:23 2016 +1300
Branches: master
https://developer.blender.org/rB477078defa0eab48db167a04c208782d1114525c

Fix T45523: "View All" in Graph Editor does not respect Y axis with small values

The previous threshold used to prevent the Graph Editor from imploding if
presented with a flat (or nearly flat, accounting for floating point precision)
curve was too coarse, meaning that in some cases, the "View All" tool would end
up behaving weirdly.

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

M	source/blender/editors/space_graph/graph_edit.c

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

diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index 6042100..bf66b30 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -140,8 +140,14 @@ void get_graph_keyframe_extents(bAnimContext *ac, float *xmin, float *xmax, floa
 		
 		/* ensure that the extents are not too extreme that view implodes...*/
 		if (foundBounds) {
-			if ((xmin && xmax) && (fabsf(*xmax - *xmin) < 0.1f)) *xmax += 0.1f;
-			if ((ymin && ymax) && (fabsf(*ymax - *ymin) < 0.1f)) *ymax += 0.1f;
+			if ((xmin && xmax) && (fabsf(*xmax - *xmin) < 0.001f)) {
+				*xmin -= 0.0005f;
+				*xmax += 0.0005f;
+			}
+			if ((ymin && ymax) && (fabsf(*ymax - *ymin) < 0.001f)) {
+				*ymax -= 0.0005f;
+				*ymax += 0.0005f;
+			}
 		}
 		else {
 			if (xmin) *xmin = (float)PSFRA;




More information about the Bf-blender-cvs mailing list