MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / GetResizeBorderRect

Function GetResizeBorderRect

extern/imgui/imgui.cpp:6229–6240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6227};
6228
6229static ImRect GetResizeBorderRect(ImGuiWindow* window, int border_n, float perp_padding, float thickness)
6230{
6231 ImRect rect = window->Rect();
6232 if (thickness == 0.0f)
6233 rect.Max -= ImVec2(1, 1);
6234 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); }
6235 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); }
6236 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); }
6237 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); }
6238 IM_ASSERT(0);
6239 return ImRect();
6240}
6241
6242// 0..3: corners (Lower-right, Lower-left, Unused, Unused)
6243ImGuiID ImGui::GetWindowResizeCornerID(ImGuiWindow* window, int n)

Callers 2

Calls 2

ImVec2Function · 0.85
ImRectFunction · 0.70

Tested by

no test coverage detected