Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-04-24 18:46:54 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-04-24 18:48:43 +0400
commit258a9b5fc1f024a371bd43cefeb94a5b2d1f3ce5 (patch)
tree308487fa008e50d7982418fd6aca936ecd3cd794 /source/blender/blenkernel/intern/idprop.c
parentf6da871d9de1e3dff6b072ac1e55c9a3c12bc8a2 (diff)
Fix T39867: Hotkey is not displayed in the node editor's menu.
Making both keymap and menu values the same, and adding a (debug only) check in IDP_EqualsProperties_ex() warning when comparing two floats with nearly the same value.
Diffstat (limited to 'source/blender/blenkernel/intern/idprop.c')
-rw-r--r--source/blender/blenkernel/intern/idprop.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 23d55ad90df..8b9231204de 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -35,6 +35,7 @@
#include "BLI_utildefines.h"
#include "BLI_string.h"
#include "BLI_listbase.h"
+#include "BLI_math.h"
#include "BKE_idprop.h"
#include "BKE_library.h"
@@ -820,6 +821,19 @@ bool IDP_EqualsProperties_ex(IDProperty *prop1, IDProperty *prop2, const bool is
case IDP_INT:
return (IDP_Int(prop1) == IDP_Int(prop2));
case IDP_FLOAT:
+#ifdef DEBUG
+ {
+ float p1 = IDP_Float(prop1);
+ float p2 = IDP_Float(prop2);
+ if ((p1 != p2) && ((fabs(p1 - p2) / max_ff(p1, p2)) < 0.001)) {
+ printf("WARNING: Comparing two float properties that have nearly the same value (%f vs. %f)\n", p1, p2);
+ printf(" p1: ");
+ IDP_spit(prop1);
+ printf(" p2: ");
+ IDP_spit(prop2);
+ }
+ }
+#endif
return (IDP_Float(prop1) == IDP_Float(prop2));
case IDP_DOUBLE:
return (IDP_Double(prop1) == IDP_Double(prop2));