diff options
author | Joshua Leung <aligorith@gmail.com> | 2016-01-22 15:56:23 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2016-01-22 15:56:45 +0300 |
commit | 477078defa0eab48db167a04c208782d1114525c (patch) | |
tree | a94aa40bbf5ac44dec1dc91feaa563e57a8ccea9 /source/blender/editors/space_graph/graph_edit.c | |
parent | 56e729105a48fe71b82c8131888910ba3a6451b6 (diff) |
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.
Diffstat (limited to 'source/blender/editors/space_graph/graph_edit.c')
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 6042100a984..bf66b3087fd 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; |