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.
This commit is contained in:
Bastien Montagne 2014-04-24 16:46:54 +02:00
parent f6da871d9d
commit 258a9b5fc1
Notes: blender-bot 2023-02-14 10:46:02 +01:00
Referenced by issue #39867, Hotkey is not displayed in the node editor's menu
2 changed files with 15 additions and 1 deletions

View File

@ -164,7 +164,7 @@ class NODE_MT_view(Menu):
layout.operator("node.backimage_move", text="Backdrop move")
layout.operator("node.backimage_zoom", text="Backdrop zoom in").factor = 1.2
layout.operator("node.backimage_zoom", text="Backdrop zoom out").factor = 0.833
layout.operator("node.backimage_zoom", text="Backdrop zoom out").factor = 0.83333
layout.operator("node.backimage_fit", text="Fit backdrop to available space")
layout.separator()

View File

@ -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));