diff --git a/nuklear.h b/nuklear.h index f60af41..eab9481 100644 --- a/nuklear.h +++ b/nuklear.h @@ -281,6 +281,9 @@ typedef unsigned char nk_byte; * =========================================================================== */ #define NK_UNDEFINED (-1.0f) #define NK_FLAG(x) (1 << (x)) +#define NK_STRINGIFY(x) #x +#define NK_LINE_STR(x) NK_STRINGIFY(x) +#define NK_FILE_LINE __FILE__":"NK_LINE_STR(__LINE__) struct nk_buffer; struct nk_allocator; @@ -572,7 +575,7 @@ NK_API void nk_group_end(struct nk_context*); /* Layout: Tree */ #define nk_tree_push(ctx, type, title, state) nk_tree_push_hashed(ctx, type, title, state, __FILE__,nk_strlen(__FILE__),__LINE__) -#define nk_tree_push_id(ctx, type, tile, state, id) nk_tree_push_hashed(ctx, type, title, state, __FILE__,nk_strlen(__FILE__),id) +#define nk_tree_push_id(ctx, type, title, state, id) nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id) NK_API int nk_tree_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed); NK_API void nk_tree_pop(struct nk_context*); @@ -16583,7 +16586,7 @@ nk_tree_push_hashed(struct nk_context *ctx, enum nk_tree_type type, /* find or create tab persistent state (open/closed) */ title_len = (int)nk_strlen(title); - title_hash = nk_murmur_hash(title, (int)title_len, (nk_hash)line); + title_hash = nk_murmur_hash(title, (int)title_len, (nk_hash)type); if (hash) title_hash += nk_murmur_hash(hash, len, (nk_hash)line); state = nk_find_value(win, title_hash); if (!state) {