MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / RenderNavHighlight

Method RenderNavHighlight

KBotExt/imgui/imgui.cpp:3438–3468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3436}
3437
3438void ImGui::RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFlags flags)
3439{
3440 ImGuiContext& g = *GImGui;
3441 if (id != g.NavId)
3442 return;
3443 if (g.NavDisableHighlight && !(flags & ImGuiNavHighlightFlags_AlwaysDraw))
3444 return;
3445 ImGuiWindow* window = g.CurrentWindow;
3446 if (window->DC.NavHideHighlightOneFrame)
3447 return;
3448
3449 float rounding = (flags & ImGuiNavHighlightFlags_NoRounding) ? 0.0f : g.Style.FrameRounding;
3450 ImRect display_rect = bb;
3451 display_rect.ClipWith(window->ClipRect);
3452 if (flags & ImGuiNavHighlightFlags_TypeDefault)
3453 {
3454 const float THICKNESS = 2.0f;
3455 const float DISTANCE = 3.0f + THICKNESS * 0.5f;
3456 display_rect.Expand(ImVec2(DISTANCE, DISTANCE));
3457 bool fully_visible = window->ClipRect.Contains(display_rect);
3458 if (!fully_visible)
3459 window->DrawList->PushClipRect(display_rect.Min, display_rect.Max);
3460 window->DrawList->AddRect(display_rect.Min + ImVec2(THICKNESS * 0.5f, THICKNESS * 0.5f), display_rect.Max - ImVec2(THICKNESS * 0.5f, THICKNESS * 0.5f), GetColorU32(ImGuiCol_NavHighlight), rounding, 0, THICKNESS);
3461 if (!fully_visible)
3462 window->DrawList->PopClipRect();
3463 }
3464 if (flags & ImGuiNavHighlightFlags_TypeThin)
3465 {
3466 window->DrawList->AddRect(display_rect.Min, display_rect.Max, GetColorU32(ImGuiCol_NavHighlight), rounding, 0, 1.0f);
3467 }
3468}
3469
3470void ImGui::RenderMouseCursor(ImVec2 base_pos, float base_scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow)
3471{

Callers

nothing calls this directly

Calls 5

ImVec2Function · 0.85
ContainsMethod · 0.80
AddRectMethod · 0.80
PushClipRectMethod · 0.45
PopClipRectMethod · 0.45

Tested by

no test coverage detected