MCPcopy Create free account
hub / github.com/cinder/Cinder / RenderNavCursor

Method RenderNavCursor

src/imgui/imgui.cpp:3894–3926  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3892}
3893
3894void ImGui::RenderNavCursor(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFlags flags)
3895{
3896 ImGuiContext& g = *GImGui;
3897 if (id != g.NavId)
3898 return;
3899 if (!g.NavCursorVisible && !(flags & ImGuiNavRenderCursorFlags_AlwaysDraw))
3900 return;
3901 if (id == g.LastItemData.ID && (g.LastItemData.ItemFlags & ImGuiItemFlags_NoNav))
3902 return;
3903 ImGuiWindow* window = g.CurrentWindow;
3904 if (window->DC.NavHideHighlightOneFrame)
3905 return;
3906
3907 float rounding = (flags & ImGuiNavRenderCursorFlags_NoRounding) ? 0.0f : g.Style.FrameRounding;
3908 ImRect display_rect = bb;
3909 display_rect.ClipWith(window->ClipRect);
3910 const float thickness = 2.0f;
3911 if (flags & ImGuiNavRenderCursorFlags_Compact)
3912 {
3913 window->DrawList->AddRect(display_rect.Min, display_rect.Max, GetColorU32(ImGuiCol_NavCursor), rounding, 0, thickness);
3914 }
3915 else
3916 {
3917 const float distance = 3.0f + thickness * 0.5f;
3918 display_rect.Expand(ImVec2(distance, distance));
3919 bool fully_visible = window->ClipRect.Contains(display_rect);
3920 if (!fully_visible)
3921 window->DrawList->PushClipRect(display_rect.Min, display_rect.Max);
3922 window->DrawList->AddRect(display_rect.Min, display_rect.Max, GetColorU32(ImGuiCol_NavCursor), rounding, 0, thickness);
3923 if (!fully_visible)
3924 window->DrawList->PopClipRect();
3925 }
3926}
3927
3928void ImGui::RenderMouseCursor(ImVec2 base_pos, float base_scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow)
3929{

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected