imgui-test: Added extra item info callbacks. Using nav_bb for interactions when possible. Comments, Demo tweaks.

This commit is contained in:
omar
2019-01-30 10:52:13 +01:00
parent aacf993ee1
commit 0a233a505d
4 changed files with 22 additions and 12 deletions

View File

@ -1278,6 +1278,7 @@ ImVec2 ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c,
return proj_ca;
}
// Consider using _stricmp/_strnicmp under Windows or strcasecmp/strncasecmp. We don't actually use either ImStricmp/ImStrnicmp in the codebase any more.
int ImStricmp(const char* str1, const char* str2)
{
int d;
@ -1294,10 +1295,11 @@ int ImStrnicmp(const char* str1, const char* str2, size_t count)
void ImStrncpy(char* dst, const char* src, size_t count)
{
if (count < 1) return;
if (count < 1)
return;
if (count > 1)
strncpy(dst, src, count-1);
dst[count-1] = 0;
strncpy(dst, src, count - 1);
dst[count - 1] = 0;
}
char* ImStrdup(const char* str)
@ -2796,7 +2798,7 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg)
#ifdef IMGUI_ENABLE_TEST_ENGINE
if (id != 0)
ImGuiTestEngineHook_ItemAdd(&g, bb, id);
ImGuiTestEngineHook_ItemAdd(&g, nav_bb_arg ? *nav_bb_arg : bb, id);
#endif
// Clipping test