MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / GetResizeBorderRect

Function GetResizeBorderRect

plugins/Cardinal/src/DearImGui/imgui.cpp:5517–5528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5515};
5516
5517static ImRect GetResizeBorderRect(ImGuiWindow* window, int border_n, float perp_padding, float thickness)
5518{
5519 ImRect rect = window->Rect();
5520 if (thickness == 0.0f)
5521 rect.Max -= ImVec2(1, 1);
5522 if (border_n == ImGuiDir_Left) { return ImRect(rect.Min.x - thickness, rect.Min.y + perp_padding, rect.Min.x + thickness, rect.Max.y - perp_padding); }
5523 if (border_n == ImGuiDir_Right) { return ImRect(rect.Max.x - thickness, rect.Min.y + perp_padding, rect.Max.x + thickness, rect.Max.y - perp_padding); }
5524 if (border_n == ImGuiDir_Up) { return ImRect(rect.Min.x + perp_padding, rect.Min.y - thickness, rect.Max.x - perp_padding, rect.Min.y + thickness); }
5525 if (border_n == ImGuiDir_Down) { return ImRect(rect.Min.x + perp_padding, rect.Max.y - thickness, rect.Max.x - perp_padding, rect.Max.y + thickness); }
5526 IM_ASSERT(0);
5527 return ImRect();
5528}
5529
5530// 0..3: corners (Lower-right, Lower-left, Unused, Unused)
5531ImGuiID ImGui::GetWindowResizeCornerID(ImGuiWindow* window, int n)

Callers 2

Calls 3

ImVec2Function · 0.85
RectMethod · 0.80
ImRectFunction · 0.70

Tested by

no test coverage detected