MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / CalcWrapWidthForPos

Method CalcWrapWidthForPos

imgui_tiny_app/imgui/imgui.cpp:5170–5192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5168}
5169
5170float ImGui::CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x)
5171{
5172 if (wrap_pos_x < 0.0f)
5173 return 0.0f;
5174
5175 ImGuiContext& g = *GImGui;
5176 ImGuiWindow* window = g.CurrentWindow;
5177 if (wrap_pos_x == 0.0f)
5178 {
5179 // We could decide to setup a default wrapping max point for auto-resizing windows,
5180 // or have auto-wrap (with unspecified wrapping pos) behave as a ContentSize extending function?
5181 //if (window->Hidden && (window->Flags & ImGuiWindowFlags_AlwaysAutoResize))
5182 // wrap_pos_x = ImMax(window->WorkRect.Min.x + g.FontSize * 10.0f, window->WorkRect.Max.x);
5183 //else
5184 wrap_pos_x = window->WorkRect.Max.x;
5185 }
5186 else if (wrap_pos_x > 0.0f)
5187 {
5188 wrap_pos_x += window->Pos.x - window->Scroll.x; // wrap_pos_x is provided is window local space
5189 }
5190
5191 return ImMax(wrap_pos_x - pos.x, 1.0f);
5192}
5193
5194// IM_ALLOC() == ImGui::MemAlloc()
5195void* ImGui::MemAlloc(size_t size)

Callers

nothing calls this directly

Calls 1

ImMaxFunction · 0.85

Tested by

no test coverage detected