| 1696 | } |
| 1697 | |
| 1698 | void 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) |
| 1699 | { |
| 1700 | if ((col & IM_COL32_A_MASK) == 0) |
| 1701 | return; |
| 1702 | |
| 1703 | // Accept null ranges |
| 1704 | if (text_begin == text_end || text_begin[0] == 0) |
| 1705 | return; |
| 1706 | // No need to strlen() here: font->RenderText() will do it and may early out. |
| 1707 | |
| 1708 | // Pull default font/size from the shared ImDrawListSharedData instance |
| 1709 | if (font == NULL) |
| 1710 | font = _Data->Font; |
| 1711 | if (font_size == 0.0f) |
| 1712 | font_size = _Data->FontSize; |
| 1713 | |
| 1714 | ImVec4 clip_rect = _CmdHeader.ClipRect; |
| 1715 | if (cpu_fine_clip_rect) |
| 1716 | { |
| 1717 | clip_rect.x = ImMax(clip_rect.x, cpu_fine_clip_rect->x); |
| 1718 | clip_rect.y = ImMax(clip_rect.y, cpu_fine_clip_rect->y); |
| 1719 | clip_rect.z = ImMin(clip_rect.z, cpu_fine_clip_rect->z); |
| 1720 | clip_rect.w = ImMin(clip_rect.w, cpu_fine_clip_rect->w); |
| 1721 | } |
| 1722 | font->RenderText(this, font_size, pos, col, clip_rect, text_begin, text_end, wrap_width, (cpu_fine_clip_rect != NULL) ? ImDrawTextFlags_CpuFineClip : ImDrawTextFlags_None); |
| 1723 | } |
| 1724 | |
| 1725 | void ImDrawList::AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end) |
| 1726 | { |
no test coverage detected