From 69fca66a81420c154f90807d60c81aff0cd53fa6 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 11 May 2009 11:51:30 +0000 Subject: 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 --- source/blender/blenkernel/intern/fcurve.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 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 cade555a07a..fed5ffc2ebd 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -210,8 +210,10 @@ void calc_fcurve_bounds (FCurve *fcu, float *xmin, float *xmax, float *ymin, flo BezTriple *bezt; for (bezt=fcu->bezt, i=0; i < fcu->totvert; bezt++, i++) { - yminv= MIN2(yminv, bezt->vec[1][1]); - ymaxv= MAX2(ymaxv, bezt->vec[1][1]); + if (bezt->vec[1][1] < yminv) + yminv= bezt->vec[1][1]; + if (bezt->vec[1][1] > ymaxv) + ymaxv= bezt->vec[1][1]; } } } @@ -227,8 +229,10 @@ void calc_fcurve_bounds (FCurve *fcu, float *xmin, float *xmax, float *ymin, flo FPoint *fpt; for (fpt=fcu->fpt, i=0; i < fcu->totvert; fpt++, i++) { - yminv= MIN2(yminv, fpt->vec[1]); - ymaxv= MAX2(ymaxv, fpt->vec[1]); + if (fpt->vec[1] < yminv) + yminv= fpt->vec[1]; + if (fpt->vec[1] > ymaxv) + ymaxv= fpt->vec[1]; } } } -- cgit v1.2.3