diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-05-11 15:51:30 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-05-11 15:51:30 +0400 |
commit | 69fca66a81420c154f90807d60c81aff0cd53fa6 (patch) | |
tree | 5f9855a4d1967648a6cc74f654ea9fa74cc3bf06 /source/blender/editors/space_graph | |
parent | 1a76f8a9f3d62bf9b0c4e376b3464f411fe4aaea (diff) |
Graph Editor Bugfix: 'HomeKey' (View All) wasn't correctly calculating y-extents
It was only using the y-extents of the last F-Curve it encountered
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index d4bdfce5414..a3d0b50b9a6 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -116,19 +116,21 @@ static void get_graph_keyframe_extents (bAnimContext *ac, float *xmin, float *xm for (ale= anim_data.first; ale; ale= ale->next) { Object *nob= NULL; //ANIM_nla_mapping_get(ac, ale); FCurve *fcu= (FCurve *)ale->key_data; - float tmin, tmax; + float txmin, txmax, tymin, tymax; /* get range and apply necessary scaling before */ - calc_fcurve_bounds(fcu, &tmin, &tmax, ymin, ymax); + calc_fcurve_bounds(fcu, &txmin, &txmax, &tymin, &tymax); if (nob) { - tmin= get_action_frame_inv(nob, tmin); - tmax= get_action_frame_inv(nob, tmax); + txmin= get_action_frame_inv(nob, txmin); + txmax= get_action_frame_inv(nob, txmax); } /* try to set cur using these values, if they're more extreme than previously set values */ - if (xmin) *xmin= MIN2(*xmin, tmin); - if (xmax) *xmax= MAX2(*xmax, tmax); + if ((xmin) && (txmin < *xmin)) *xmin= txmin; + if ((xmax) && (txmax > *xmax)) *xmax= txmax; + if ((ymin) && (tymin < *ymin)) *ymin= tymin; + if ((ymax) && (tymax > *ymax)) *ymax= tymax; } /* free memory */ |