MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / GetResizeBorderRect

Function GetResizeBorderRect

lib/imgui/imgui.cpp:4948–4958  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4946};
4947
4948static ImRect GetResizeBorderRect(ImGuiWindow* window, int border_n, float perp_padding, float thickness)
4949{
4950 ImRect rect = window->Rect();
4951 if (thickness == 0.0f) rect.Max -= ImVec2(1,1);
4952 if (border_n == 0) return ImRect(rect.Min.x + perp_padding, rect.Min.y - thickness, rect.Max.x - perp_padding, rect.Min.y + thickness); // Top
4953 if (border_n == 1) return ImRect(rect.Max.x - thickness, rect.Min.y + perp_padding, rect.Max.x + thickness, rect.Max.y - perp_padding); // Right
4954 if (border_n == 2) return ImRect(rect.Min.x + perp_padding, rect.Max.y - thickness, rect.Max.x - perp_padding, rect.Max.y + thickness); // Bottom
4955 if (border_n == 3) return ImRect(rect.Min.x - thickness, rect.Min.y + perp_padding, rect.Min.x + thickness, rect.Max.y - perp_padding); // Left
4956 IM_ASSERT(0);
4957 return ImRect();
4958}
4959
4960// 0..3: corners (Lower-right, Lower-left, Unused, Unused)
4961// 4..7: borders (Top, Right, Bottom, Left)

Callers 2

UpdateManualResizeMethod · 0.85

Calls 2

ImVec2Class · 0.85
ImRectFunction · 0.70

Tested by

no test coverage detected