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

Method RenderWindowOuterBorders

KBotExt/imgui/imgui.cpp:5945–5967  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5943}
5944
5945static void ImGui::RenderWindowOuterBorders(ImGuiWindow* window)
5946{
5947 ImGuiContext& g = *GImGui;
5948 float rounding = window->WindowRounding;
5949 float border_size = window->WindowBorderSize;
5950 if (border_size > 0.0f && !(window->Flags & ImGuiWindowFlags_NoBackground))
5951 window->DrawList->AddRect(window->Pos, window->Pos + window->Size, GetColorU32(ImGuiCol_Border), rounding, 0, border_size);
5952
5953 int border_held = window->ResizeBorderHeld;
5954 if (border_held != -1)
5955 {
5956 const ImGuiResizeBorderDef& def = resize_border_def[border_held];
5957 ImRect border_r = GetResizeBorderRect(window, border_held, rounding, 0.0f);
5958 window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.SegmentN1) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle - IM_PI * 0.25f, def.OuterAngle);
5959 window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.SegmentN2) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle, def.OuterAngle + IM_PI * 0.25f);
5960 window->DrawList->PathStroke(GetColorU32(ImGuiCol_SeparatorActive), 0, ImMax(2.0f, border_size)); // Thicker than usual
5961 }
5962 if (g.Style.FrameBorderSize > 0 && !(window->Flags & ImGuiWindowFlags_NoTitleBar))
5963 {
5964 float y = window->Pos.y + window->TitleBarHeight() - 1;
5965 window->DrawList->AddLine(ImVec2(window->Pos.x + border_size, y), ImVec2(window->Pos.x + window->Size.x - border_size, y), GetColorU32(ImGuiCol_Border), g.Style.FrameBorderSize);
5966 }
5967}
5968
5969// Draw background and borders
5970// Draw and handle scrollbars

Callers

nothing calls this directly

Calls 8

GetResizeBorderRectFunction · 0.85
ImLerpFunction · 0.85
ImVec2Function · 0.85
ImMaxFunction · 0.85
AddRectMethod · 0.80
PathArcToMethod · 0.80
PathStrokeMethod · 0.80
AddLineMethod · 0.80

Tested by

no test coverage detected