diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-01-14 08:19:04 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-01-14 08:19:04 +0300 |
commit | af4bc28c44f08629ba2bd6afb406edfe19011b63 (patch) | |
tree | e5ac1e943a68a78fbfaa0dde82980ac577a1ca42 /source/blender/blenkernel/intern/fcurve.c | |
parent | 423fbcfa5c3674fcbd828f0b51de863cb74d6b9d (diff) |
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.
Diffstat (limited to 'source/blender/blenkernel/intern/fcurve.c')
-rw-r--r-- | source/blender/blenkernel/intern/fcurve.c | 11 |
1 files changed, 5 insertions, 6 deletions
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; } } |