1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-28 17:40:56 +01:00

ImFont: fixed minor bug with CPU-side vertical clipping of text.

This commit is contained in:
ocornut 2015-07-15 13:34:59 -06:00
parent a56768463a
commit 6c3ab6fc9b

View File

@ -10795,7 +10795,6 @@ void ImFont::RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_re
if (!word_wrap_enabled && y + line_height < clip_rect.y)
while (s < text_end && *s != '\n') // Fast-forward to next line
s++;
continue;
}
if (c == '\r')
@ -10847,6 +10846,11 @@ void ImFont::RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_re
v2 = v1 + ((clip_rect.w - y1) / (y2 - y1)) * (v2 - v1);
y2 = clip_rect.w;
}
if (y1 >= y2)
{
x += char_width;
continue;
}
}
// NB: we are not calling PrimRectUV() here because non-inlined causes too much overhead in a debug build.