| 2336 | } |
| 2337 | |
| 2338 | void ImGui::RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width) |
| 2339 | { |
| 2340 | ImGuiContext& g = *GImGui; |
| 2341 | ImGuiWindow* window = g.CurrentWindow; |
| 2342 | |
| 2343 | if (!text_end) |
| 2344 | text_end = text + strlen(text); // FIXME-OPT |
| 2345 | |
| 2346 | if (text != text_end) |
| 2347 | { |
| 2348 | window->DrawList->AddText(g.Font, g.FontSize, pos, GetColorU32(ImGuiCol_Text), text, text_end, wrap_width); |
| 2349 | if (g.LogEnabled) |
| 2350 | LogRenderedText(&pos, text, text_end); |
| 2351 | } |
| 2352 | } |
| 2353 | |
| 2354 | // Default clip_rect uses (pos_min,pos_max) |
| 2355 | // Handle clipping on CPU immediately (vs typically let the GPU clip the triangles that are overlapping the clipping rectangle edges) |