[Bf-blender-cvs] [29a7310] master: UI: prevent softrange from becoming nan

Campbell Barton noreply at git.blender.org
Wed Jun 29 04:08:44 CEST 2016


Commit: 29a73106b45aa8d2367aebc3fde43cc2e2f5341e
Author: Campbell Barton
Date:   Wed Jun 29 12:00:17 2016 +1000
Branches: master
https://developer.blender.org/rB29a73106b45aa8d2367aebc3fde43cc2e2f5341e

UI: prevent softrange from becoming nan

Quiets assert

===================================================================

M	source/blender/editors/interface/interface.c

===================================================================

diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 7799006..ba7240b 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -2576,9 +2576,11 @@ static void ui_set_but_soft_range(uiBut *but)
 	}
 	else if (but->poin && (but->pointype & UI_BUT_POIN_TYPES)) {
 		float value = ui_but_value_get(but);
-		CLAMP(value, but->hardmin, but->hardmax);
-		but->softmin = min_ff(but->softmin, value);
-		but->softmax = max_ff(but->softmax, value);
+		if (isfinite(value)) {
+			CLAMP(value, but->hardmin, but->hardmax);
+			but->softmin = min_ff(but->softmin, value);
+			but->softmax = max_ff(but->softmax, value);
+		}
 	}
 	else {
 		BLI_assert(0);




More information about the Bf-blender-cvs mailing list