NLA Branch: Merge from 2.5 20116:20214
[blender-staging.git] / source / blender / blenkernel / intern / fcurve.c
index 1a40911170e1ae3d5e4a835b7877d9f518db0a57..b30eba5a631a6a6df3a6c1d8365d25ed63a7609a 100644 (file)
@@ -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];
                                }
                        }
                }