[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26307] trunk/blender/source/blender/ editors/interface/interface.c: Fix #20831: setting shadowbuffersize to 10240 only possible via typing it in.

Brecht Van Lommel brecht at blender.org
Tue Jan 26 18:14:15 CET 2010


Revision: 26307
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26307
Author:   blendix
Date:     2010-01-26 18:14:13 +0100 (Tue, 26 Jan 2010)

Log Message:
-----------
Fix #20831: setting shadowbuffersize to 10240 only possible via typing it in.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface.c

Modified: trunk/blender/source/blender/editors/interface/interface.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface.c	2010-01-26 17:09:32 UTC (rev 26306)
+++ trunk/blender/source/blender/editors/interface/interface.c	2010-01-26 17:14:13 UTC (rev 26307)
@@ -26,6 +26,7 @@
  */
 
 #include <float.h>
+#include <limits.h>
 #include <math.h>
 #include <string.h>
  
@@ -1680,12 +1681,14 @@
 	if(but->rnaprop) {
 		type= RNA_property_type(but->rnaprop);
 
+		/* clamp button range to something reasonable in case
+		 * we get -inf/inf from RNA properties */
 		if(type == PROP_INT) {
 			int imin, imax, istep;
 
 			RNA_property_int_ui_range(&but->rnapoin, but->rnaprop, &imin, &imax, &istep);
-			softmin= imin;
-			softmax= imax;
+			softmin= (imin == INT_MIN)? -1e4: imin;
+			softmax= (imin == INT_MAX)? 1e4: imax;
 			step= istep;
 			precision= 1;
 		}
@@ -1693,19 +1696,14 @@
 			float fmin, fmax, fstep, fprecision;
 
 			RNA_property_float_ui_range(&but->rnapoin, but->rnaprop, &fmin, &fmax, &fstep, &fprecision);
-			softmin= fmin;
-			softmax= fmax;
+			softmin= (fmin == -FLT_MAX)? -1e4: fmin;
+			softmax= (fmax == FLT_MAX)? 1e4: fmax;
 			step= fstep;
 			precision= fprecision;
 		}
 		else
 			return;
 
-		/* clamp button range to something reasonable in case
-		 * we get -inf/inf from RNA properties */
-		softmin= MAX2(softmin, -1e4);
-		softmax= MIN2(softmax, 1e4);
-
 		/* if the value goes out of the soft/max range, adapt the range */
 		if(value+1e-10 < softmin) {
 			if(value < 0.0)





More information about the Bf-blender-cvs mailing list