MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / ClampWindowPos

Function ClampWindowPos

extern/imgui/imgui.cpp:6415–6422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6413}
6414
6415static inline void ClampWindowPos(ImGuiWindow* window, const ImRect& visibility_rect)
6416{
6417 ImGuiContext& g = *GImGui;
6418 ImVec2 size_for_clamping = window->Size;
6419 if (g.IO.ConfigWindowsMoveFromTitleBarOnly && (!(window->Flags & ImGuiWindowFlags_NoTitleBar) || window->DockNodeAsHost))
6420 size_for_clamping.y = ImGui::GetFrameHeight(); // Not using window->TitleBarHeight() as DockNodeAsHost will report 0.0f here.
6421 window->Pos = ImClamp(window->Pos, visibility_rect.Min - size_for_clamping, visibility_rect.Max);
6422}
6423
6424static void ImGui::RenderWindowOuterBorders(ImGuiWindow* window)
6425{

Callers 1

BeginMethod · 0.85

Calls 1

ImClampFunction · 0.85

Tested by

no test coverage detected