fix for incorrect check to find largest axis (was checking Y twice, not Z).
authorCampbell Barton <ideasman42@gmail.com>
Sun, 19 Feb 2012 05:17:55 +0000 (05:17 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 19 Feb 2012 05:17:55 +0000 (05:17 +0000)
source/blender/editors/space_view3d/view3d_draw.c

index 4f46a746b9e4cc123841c0cef7bee1e37e03102e..c73d8e14f05dda6ca6931ce79432f9cf8e1714ab 100644 (file)
@@ -1584,7 +1584,7 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d)
                                /* calc window coord */
                                initgrabz(rv3d, 0.0, 0.0, 0.0);
                                ED_view3d_win_to_delta(ar, mval_f, vec);
-                               fac= MAX3( fabs(vec[0]), fabs(vec[1]), fabs(vec[1]) );
+                               fac= maxf(fabsf(vec[0]), maxf(fabsf(vec[1]), fabsf(vec[2]))); /* largest abs axis */
                                fac= 1.0f/fac;
 
                                asp= ( (float)ibuf->y)/(float)ibuf->x;