MCPcopy Create free account
hub / github.com/Wemino/MarkerPatch / CalcWrapWidthForPos

Method CalcWrapWidthForPos

include/imgui/imgui.cpp:5077–5099  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5075}
5076
5077float ImGui::CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x)
5078{
5079 if (wrap_pos_x < 0.0f)
5080 return 0.0f;
5081
5082 ImGuiContext& g = *GImGui;
5083 ImGuiWindow* window = g.CurrentWindow;
5084 if (wrap_pos_x == 0.0f)
5085 {
5086 // We could decide to setup a default wrapping max point for auto-resizing windows,
5087 // or have auto-wrap (with unspecified wrapping pos) behave as a ContentSize extending function?
5088 //if (window->Hidden && (window->Flags & ImGuiWindowFlags_AlwaysAutoResize))
5089 // wrap_pos_x = ImMax(window->WorkRect.Min.x + g.FontSize * 10.0f, window->WorkRect.Max.x);
5090 //else
5091 wrap_pos_x = window->WorkRect.Max.x;
5092 }
5093 else if (wrap_pos_x > 0.0f)
5094 {
5095 wrap_pos_x += window->Pos.x - window->Scroll.x; // wrap_pos_x is provided is window local space
5096 }
5097
5098 return ImMax(wrap_pos_x - pos.x, 1.0f);
5099}
5100
5101// IM_ALLOC() == ImGui::MemAlloc()
5102void* ImGui::MemAlloc(size_t size)

Callers

nothing calls this directly

Calls 1

ImMaxFunction · 0.85

Tested by

no test coverage detected