MCPcopy Create free account
hub / github.com/VictorGordan/opengl-tutorials / RenderWindowOuterBorders

Method RenderWindowOuterBorders

ImGUI GLFW Tutorial/imgui/imgui.cpp:5506–5528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5504}
5505
5506static void ImGui::RenderWindowOuterBorders(ImGuiWindow* window)
5507{
5508 ImGuiContext& g = *GImGui;
5509 float rounding = window->WindowRounding;
5510 float border_size = window->WindowBorderSize;
5511 if (border_size > 0.0f && !(window->Flags & ImGuiWindowFlags_NoBackground))
5512 window->DrawList->AddRect(window->Pos, window->Pos + window->Size, GetColorU32(ImGuiCol_Border), rounding, 0, border_size);
5513
5514 int border_held = window->ResizeBorderHeld;
5515 if (border_held != -1)
5516 {
5517 const ImGuiResizeBorderDef& def = resize_border_def[border_held];
5518 ImRect border_r = GetResizeBorderRect(window, border_held, rounding, 0.0f);
5519 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);
5520 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);
5521 window->DrawList->PathStroke(GetColorU32(ImGuiCol_SeparatorActive), 0, ImMax(2.0f, border_size)); // Thicker than usual
5522 }
5523 if (g.Style.FrameBorderSize > 0 && !(window->Flags & ImGuiWindowFlags_NoTitleBar))
5524 {
5525 float y = window->Pos.y + window->TitleBarHeight() - 1;
5526 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);
5527 }
5528}
5529
5530// Draw background and borders
5531// Draw and handle scrollbars

Callers

nothing calls this directly

Calls 8

GetResizeBorderRectFunction · 0.70
ImLerpFunction · 0.70
ImVec2Function · 0.70
ImMaxFunction · 0.70
AddRectMethod · 0.45
PathArcToMethod · 0.45
PathStrokeMethod · 0.45
AddLineMethod · 0.45

Tested by

no test coverage detected