From af4bc28c44f08629ba2bd6afb406edfe19011b63 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 14 Jan 2011 05:19:04 +0000 Subject: Bugfix [#25617] HOME Key in fcurve editor doesn't center properly * When euler-rotation F-Curves had a single keyframe only, the view would be artifically extended to fill up to 57 (this comes from the radians to degrees calculations) due to a combination of the bounds- finding function enforcing a minimum separation of 1 unit between min/max. This has now been moved to the operator-level where it gets applied AFTER these conversions have taken effect * F-Curves with samples only (i.e. baked F-Curves) would be ignored by these operators. Was caused by using a poll calback that only considered whether there were keyframes. Hopefully this is sufficient; otherwise a hybrid poll method will be needed. --- source/blender/blenkernel/intern/fcurve.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'source/blender/blenkernel/intern/fcurve.c') diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 16d332c3bcb..87dff0a58b6 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -472,11 +472,7 @@ void calc_fcurve_bounds (FCurve *fcu, float *xmin, float *xmax, float *ymin, flo foundvert=1; } - /* minimum sizes are 1.0f */ if (foundvert) { - if (xminv == xmaxv) xmaxv += 1.0f; - if (yminv == ymaxv) ymaxv += 1.0f; - if (xmin) *xmin= xminv; if (xmax) *xmax= xmaxv; @@ -484,10 +480,13 @@ void calc_fcurve_bounds (FCurve *fcu, float *xmin, float *xmax, float *ymin, flo if (ymax) *ymax= ymaxv; } else { + if (G.f & G_DEBUG) + printf("F-Curve calc bounds didn't find anything, so assuming minimum bounds of 1.0\n"); + if (xmin) *xmin= 0.0f; - if (xmax) *xmax= 0.0f; + if (xmax) *xmax= 1.0f; - if (ymin) *ymin= 1.0f; + if (ymin) *ymin= 0.0f; if (ymax) *ymax= 1.0f; } } -- cgit v1.2.3