From 57f70a29b20cb6e0a1b3805aaab61c94ec83fc61 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 2 Jul 2015 07:42:29 -0600 Subject: [PATCH] Fixed a bug with TextUnformatted() clipping of long text (#257) --- imgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 78be5fec..ce7add0d 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4934,11 +4934,11 @@ void ImGui::TextUnformatted(const char* text, const char* text_end) // Lines to skip (can't skip when logging text) if (!g.LogEnabled) { - int lines_skippable = (int)((clip_rect.y - text_pos.y) / line_height) - 1; + int lines_skippable = (int)((clip_rect.y - text_pos.y) / line_height); if (lines_skippable > 0) { int lines_skipped = 0; - while (line < text_end && lines_skipped <= lines_skippable) + while (line < text_end && lines_skipped < lines_skippable) { const char* line_end = strchr(line, '\n'); line = line_end + 1;