[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14025] trunk/blender/source/blender/src/ drawimage.c: replaced zero comparisons with FLT_EPSILON

Campbell Barton ideasman42 at gmail.com
Sun Mar 9 17:57:11 CET 2008


Revision: 14025
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14025
Author:   campbellbarton
Date:     2008-03-09 17:57:01 +0100 (Sun, 09 Mar 2008)

Log Message:
-----------
replaced zero comparisons with FLT_EPSILON

Modified Paths:
--------------
    trunk/blender/source/blender/src/drawimage.c

Modified: trunk/blender/source/blender/src/drawimage.c
===================================================================
--- trunk/blender/source/blender/src/drawimage.c	2008-03-09 15:07:01 UTC (rev 14024)
+++ trunk/blender/source/blender/src/drawimage.c	2008-03-09 16:57:01 UTC (rev 14025)
@@ -601,7 +601,7 @@
 					}
 				}
 				
-				if (totarea==0.0 || totarea==0.0) {
+				if (totarea < FLT_EPSILON || totuvarea < FLT_EPSILON) {
 					col[0] = 1.0;
 					col[1] = col[2] = 0.0;
 					glColor3fv(col);
@@ -621,7 +621,7 @@
 					if ((tface=(MTFace *)efa->tmp.p)) {
 						area = EM_face_area(efa) / totarea;
 						uvarea = tface_area(tface, efa->v4!=0) / totuvarea;
-						if (area==0.0 || uvarea==0.0) {
+						if (area < FLT_EPSILON || uvarea < FLT_EPSILON) {
 							areadiff = 1.0;
 						} else if (area>uvarea) {
 							areadiff = 1.0-(uvarea/area);





More information about the Bf-blender-cvs mailing list