MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / DebugDrawLineExtents

Method DebugDrawLineExtents

imgui_tiny_app/imgui/imgui.cpp:23900–23910  ·  view source on GitHub ↗

Draw a 10px wide rectangle around CurposPos.x using Line Y1/Y2 in current window's DrawList

Source from the content-addressed store, hash-verified

23898
23899// Draw a 10px wide rectangle around CurposPos.x using Line Y1/Y2 in current window's DrawList
23900void ImGui::DebugDrawLineExtents(ImU32 col)
23901{
23902 ImGuiContext& g = *GImGui;
23903 ImGuiWindow* window = g.CurrentWindow;
23904 float curr_x = window->DC.CursorPos.x;
23905 float line_y1 = (window->DC.IsSameLine ? window->DC.CursorPosPrevLine.y : window->DC.CursorPos.y);
23906 float line_y2 = line_y1 + (window->DC.IsSameLine ? window->DC.PrevLineSize.y : window->DC.CurrLineSize.y);
23907 window->DrawList->AddLine(ImVec2(curr_x - 5.0f, line_y1), ImVec2(curr_x + 5.0f, line_y1), col, 1.0f);
23908 window->DrawList->AddLine(ImVec2(curr_x - 0.5f, line_y1), ImVec2(curr_x - 0.5f, line_y2), col, 1.0f);
23909 window->DrawList->AddLine(ImVec2(curr_x - 5.0f, line_y2), ImVec2(curr_x + 5.0f, line_y2), col, 1.0f);
23910}
23911
23912// Draw last item rect in ForegroundDrawList (so it is always visible)
23913void ImGui::DebugDrawItemRect(ImU32 col)

Callers

nothing calls this directly

Calls 2

ImVec2Function · 0.85
AddLineMethod · 0.80

Tested by

no test coverage detected