MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / RenderChar

Method RenderChar

lib/imgui/imgui_draw.cpp:2939–2949  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2937}
2938
2939void ImFont::RenderChar(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, ImWchar c) const
2940{
2941 const ImFontGlyph* glyph = FindGlyph(c);
2942 if (!glyph || !glyph->Visible)
2943 return;
2944 float scale = (size >= 0.0f) ? (size / FontSize) : 1.0f;
2945 pos.x = IM_FLOOR(pos.x + DisplayOffset.x);
2946 pos.y = IM_FLOOR(pos.y + DisplayOffset.y);
2947 draw_list->PrimReserve(6, 4);
2948 draw_list->PrimRectUV(ImVec2(pos.x + glyph->X0 * scale, pos.y + glyph->Y0 * scale), ImVec2(pos.x + glyph->X1 * scale, pos.y + glyph->Y1 * scale), ImVec2(glyph->U0, glyph->V0), ImVec2(glyph->U1, glyph->V1), col);
2949}
2950
2951void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width, bool cpu_fine_clip) const
2952{

Callers 2

RenderTextEllipsisMethod · 0.80
ShowStyleEditorMethod · 0.80

Calls 3

ImVec2Class · 0.85
PrimReserveMethod · 0.80
PrimRectUVMethod · 0.80

Tested by

no test coverage detected