MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / AddText

Method AddText

external/imgui/imgui_draw.cpp:1728–1753  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1726}
1727
1728void ImDrawList::AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end, float wrap_width, const ImVec4* cpu_fine_clip_rect)
1729{
1730 if ((col & IM_COL32_A_MASK) == 0)
1731 return;
1732
1733 // Accept null ranges
1734 if (text_begin == text_end || text_begin[0] == 0)
1735 return;
1736 // No need to strlen() here: font->RenderText() will do it and may early out.
1737
1738 // Pull default font/size from the shared ImDrawListSharedData instance
1739 if (font == NULL)
1740 font = _Data->Font;
1741 if (font_size == 0.0f)
1742 font_size = _Data->FontSize;
1743
1744 ImVec4 clip_rect = _CmdHeader.ClipRect;
1745 if (cpu_fine_clip_rect)
1746 {
1747 clip_rect.x = ImMax(clip_rect.x, cpu_fine_clip_rect->x);
1748 clip_rect.y = ImMax(clip_rect.y, cpu_fine_clip_rect->y);
1749 clip_rect.z = ImMin(clip_rect.z, cpu_fine_clip_rect->z);
1750 clip_rect.w = ImMin(clip_rect.w, cpu_fine_clip_rect->w);
1751 }
1752 font->RenderText(this, font_size, pos, col, clip_rect, text_begin, text_end, wrap_width, (cpu_fine_clip_rect != NULL) ? ImDrawTextFlags_CpuFineClip : ImDrawTextFlags_None);
1753}
1754
1755void ImDrawList::AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end)
1756{

Callers 14

draw_keyFunction · 0.80
EndGroupBoxFunction · 0.80
run_guiFunction · 0.80
RenderTextMethod · 0.80
RenderTextWrappedMethod · 0.80
RenderTextClippedExMethod · 0.80
NavScoreItemMethod · 0.80
ShowMetricsWindowMethod · 0.80
SelectableMethod · 0.80

Calls 4

ImMaxFunction · 0.85
ImMinFunction · 0.85
ImTextCharFromUtf8Function · 0.85
RenderTextMethod · 0.45

Tested by

no test coverage detected