| 5100 | } |
| 5101 | |
| 5102 | static void ImGui::RenderWindowOuterBorders(ImGuiWindow* window) |
| 5103 | { |
| 5104 | ImGuiContext& g = *GImGui; |
| 5105 | float rounding = window->WindowRounding; |
| 5106 | float border_size = window->WindowBorderSize; |
| 5107 | if (border_size > 0.0f && !(window->Flags & ImGuiWindowFlags_NoBackground)) |
| 5108 | window->DrawList->AddRect(window->Pos, window->Pos + window->Size, GetColorU32(ImGuiCol_Border), rounding, ImDrawCornerFlags_All, border_size); |
| 5109 | |
| 5110 | int border_held = window->ResizeBorderHeld; |
| 5111 | if (border_held != -1) |
| 5112 | { |
| 5113 | struct ImGuiResizeBorderDef |
| 5114 | { |
| 5115 | ImVec2 InnerDir; |
| 5116 | ImVec2 CornerPosN1, CornerPosN2; |
| 5117 | float OuterAngle; |
| 5118 | }; |
| 5119 | static const ImGuiResizeBorderDef resize_border_def[4] = |
| 5120 | { |
| 5121 | { ImVec2(0,+1), ImVec2(0,0), ImVec2(1,0), IM_PI*1.50f }, // Top |
| 5122 | { ImVec2(-1,0), ImVec2(1,0), ImVec2(1,1), IM_PI*0.00f }, // Right |
| 5123 | { ImVec2(0,-1), ImVec2(1,1), ImVec2(0,1), IM_PI*0.50f }, // Bottom |
| 5124 | { ImVec2(+1,0), ImVec2(0,1), ImVec2(0,0), IM_PI*1.00f } // Left |
| 5125 | }; |
| 5126 | const ImGuiResizeBorderDef& def = resize_border_def[border_held]; |
| 5127 | ImRect border_r = GetResizeBorderRect(window, border_held, rounding, 0.0f); |
| 5128 | window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.CornerPosN1) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle - IM_PI*0.25f, def.OuterAngle); |
| 5129 | window->DrawList->PathArcTo(ImLerp(border_r.Min, border_r.Max, def.CornerPosN2) + ImVec2(0.5f, 0.5f) + def.InnerDir * rounding, rounding, def.OuterAngle, def.OuterAngle + IM_PI*0.25f); |
| 5130 | window->DrawList->PathStroke(GetColorU32(ImGuiCol_SeparatorActive), false, ImMax(2.0f, border_size)); // Thicker than usual |
| 5131 | } |
| 5132 | if (g.Style.FrameBorderSize > 0 && !(window->Flags & ImGuiWindowFlags_NoTitleBar)) |
| 5133 | { |
| 5134 | float y = window->Pos.y + window->TitleBarHeight() - 1; |
| 5135 | 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); |
| 5136 | } |
| 5137 | } |
| 5138 | |
| 5139 | // Draw background and borders |
| 5140 | // Draw and handle scrollbars |
nothing calls this directly
no test coverage detected