MCPcopy Create free account
hub / github.com/Wemino/EchoPatch / SameLine

Method SameLine

include/imgui/imgui.cpp:11389–11420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11387 SameLine();
11388}
11389IM_MSVC_RUNTIME_CHECKS_RESTORE
11390
11391// Gets back to previous line and continue with horizontal layout
11392// offset_from_start_x == 0 : follow right after previous item
11393// offset_from_start_x != 0 : align to specified x position (relative to window/group left)
11394// spacing_w < 0 : use default spacing if offset_from_start_x == 0, no spacing if offset_from_start_x != 0
11395// spacing_w >= 0 : enforce spacing amount
11396void ImGui::SameLine(float offset_from_start_x, float spacing_w)
11397{
11398 ImGuiContext& g = *GImGui;
11399 ImGuiWindow* window = g.CurrentWindow;
11400 if (window->SkipItems)
11401 return;
11402
11403 if (offset_from_start_x != 0.0f)
11404 {
11405 if (spacing_w < 0.0f)
11406 spacing_w = 0.0f;
11407 window->DC.CursorPos.x = window->Pos.x - window->Scroll.x + offset_from_start_x + spacing_w + window->DC.GroupOffset.x + window->DC.ColumnsOffset.x;
11408 window->DC.CursorPos.y = window->DC.CursorPosPrevLine.y;
11409 }
11410 else
11411 {
11412 if (spacing_w < 0.0f)
11413 spacing_w = g.Style.ItemSpacing.x;
11414 window->DC.CursorPos.x = window->DC.CursorPosPrevLine.x + spacing_w;
11415 window->DC.CursorPos.y = window->DC.CursorPosPrevLine.y;
11416 }
11417 window->DC.CurrLineSize = window->DC.PrevLineSize;
11418 window->DC.CurrLineTextBaseOffset = window->DC.PrevLineTextBaseOffset;
11419 window->DC.IsSameLine = true;
11420}
11421
11422ImVec2 ImGui::GetCursorScreenPos()
11423{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected