| 3164 | } |
| 3165 | |
| 3166 | void ImGui::RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width) |
| 3167 | { |
| 3168 | ImGuiContext& g = *GImGui; |
| 3169 | ImGuiWindow* window = g.CurrentWindow; |
| 3170 | |
| 3171 | if (!text_end) |
| 3172 | text_end = text + strlen(text); // FIXME-OPT |
| 3173 | |
| 3174 | if (text != text_end) |
| 3175 | { |
| 3176 | window->DrawList->AddText(g.Font, g.FontSize, pos, GetColorU32(ImGuiCol_Text), text, text_end, wrap_width); |
| 3177 | if (g.LogEnabled) |
| 3178 | LogRenderedText(&pos, text, text_end); |
| 3179 | } |
| 3180 | } |
| 3181 | |
| 3182 | // Default clip_rect uses (pos_min,pos_max) |
| 3183 | // Handle clipping on CPU immediately (vs typically let the GPU clip the triangles that are overlapping the clipping rectangle edges) |