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

Method TabItemCalcSize

include/imgui/imgui_widgets.cpp:10848–10858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10846}
10847
10848ImVec2 ImGui::TabItemCalcSize(const char* label, bool has_close_button_or_unsaved_marker)
10849{
10850 ImGuiContext& g = *GImGui;
10851 ImVec2 label_size = CalcTextSize(label, NULL, true);
10852 ImVec2 size = ImVec2(label_size.x + g.Style.FramePadding.x, label_size.y + g.Style.FramePadding.y * 2.0f);
10853 if (has_close_button_or_unsaved_marker)
10854 size.x += g.Style.FramePadding.x + (g.Style.ItemInnerSpacing.x + g.FontSize); // We use Y intentionally to fit the close button circle.
10855 else
10856 size.x += g.Style.FramePadding.x + 1.0f;
10857 return ImVec2(ImMin(size.x, TabBarCalcMaxTabWidth()), size.y);
10858}
10859
10860ImVec2 ImGui::TabItemCalcSize(ImGuiWindow*)
10861{

Callers

nothing calls this directly

Calls 2

ImVec2Function · 0.85
ImMinFunction · 0.85

Tested by

no test coverage detected