diff --git a/imgui.cpp b/imgui.cpp index 0d21ed21..a32eb07e 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -2378,7 +2378,7 @@ void ImGui::ItemSize(const ImRect& bb, float text_offset_y) ItemSize(bb.GetSize(), text_offset_y); } -static ImGuiDir inline NavScoreItemGetQuadrant(float dx, float dy) +ImGuiDir ImGetDirQuadrantFromDelta(float dx, float dy) { if (ImFabs(dx) > ImFabs(dy)) return (dx > 0.0f) ? ImGuiDir_Right : ImGuiDir_Left; @@ -2454,7 +2454,7 @@ static bool NavScoreItem(ImGuiNavMoveResult* result, ImRect cand) dax = dbx; day = dby; dist_axial = dist_box; - quadrant = NavScoreItemGetQuadrant(dbx, dby); + quadrant = ImGetDirQuadrantFromDelta(dbx, dby); } else if (dcx != 0.0f || dcy != 0.0f) { @@ -2462,7 +2462,7 @@ static bool NavScoreItem(ImGuiNavMoveResult* result, ImRect cand) dax = dcx; day = dcy; dist_axial = dist_center; - quadrant = NavScoreItemGetQuadrant(dcx, dcy); + quadrant = ImGetDirQuadrantFromDelta(dcx, dcy); } else { diff --git a/imgui_internal.h b/imgui_internal.h index b55246d3..d5d4d4ed 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -127,6 +127,7 @@ IMGUI_API ImVec2 ImLineClosestPoint(const ImVec2& a, const ImVec2& b, con IMGUI_API bool ImTriangleContainsPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p); IMGUI_API ImVec2 ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p); IMGUI_API void ImTriangleBarycentricCoords(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p, float& out_u, float& out_v, float& out_w); +IMGUI_API ImGuiDir ImGetDirQuadrantFromDelta(float dx, float dy); // Helpers: String IMGUI_API int ImStricmp(const char* str1, const char* str2);