Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IMGUI_API void TextFramed(const char* fmt, ...) IM_FMTARGS(1);
- void TextFramed(const char* fmt, ...)
- {
- using namespace ImGui;
- ImGuiContext& g = *GImGui;
- ImGuiWindow* window = GetCurrentWindow();
- va_list args;
- va_start(args, fmt);
- const char* text = g.TempBuffer;
- const char* text_end = g.TempBuffer + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args);
- va_end(args);
- ImRect bb = ImRect(window->DC.CursorPos, ImVec2(window->Pos.x + GetContentRegionMax().x, window->DC.CursorPos.y + g.FontSize + g.Style.FramePadding.y * 2));
- bb.Min.x -= (float)(int)(window->WindowPadding.x*0.5f) - 1;
- bb.Max.x += (float)(int)(window->WindowPadding.x*0.5f) - 1;
- ItemSize(bb, g.Style.FramePadding.y);
- if (!ItemAdd(bb, 0))
- return;
- RenderFrame(bb.Min, bb.Max, GetColorU32(ImGuiCol_Header));
- RenderText(ImVec2(bb.Min.x + g.Style.FramePadding.x, bb.Min.y + g.Style.FramePadding.y), text, text_end, false);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement