MCPcopy Create free account
hub / github.com/RenderKit/embree / NavClampRectToVisibleAreaForMoveDir

Function NavClampRectToVisibleAreaForMoveDir

tutorials/common/imgui/imgui.cpp:10364–10376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10362}
10363
10364static void inline NavClampRectToVisibleAreaForMoveDir(ImGuiDir move_dir, ImRect& r, const ImRect& clip_rect)
10365{
10366 if (move_dir == ImGuiDir_Left || move_dir == ImGuiDir_Right)
10367 {
10368 r.Min.y = ImClamp(r.Min.y, clip_rect.Min.y, clip_rect.Max.y);
10369 r.Max.y = ImClamp(r.Max.y, clip_rect.Min.y, clip_rect.Max.y);
10370 }
10371 else // FIXME: PageUp/PageDown are leaving move_dir == None
10372 {
10373 r.Min.x = ImClamp(r.Min.x, clip_rect.Min.x, clip_rect.Max.x);
10374 r.Max.x = ImClamp(r.Max.x, clip_rect.Min.x, clip_rect.Max.x);
10375 }
10376}
10377
10378// Scoring function for gamepad/keyboard directional navigation. Based on https://gist.github.com/rygorous/6981057
10379static bool ImGui::NavScoreItem(ImGuiNavItemData* result)

Callers 1

NavScoreItemMethod · 0.85

Calls 1

ImClampFunction · 0.85

Tested by

no test coverage detected