mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-17 01:04:19 +00:00
ImFont::RenderText() additional early out (typically performed at TextUnformatted() level for large chunks but this is also useful) (#200)
This commit is contained in:
parent
748837acfd
commit
d06ad43dca
1 changed files with 3 additions and 1 deletions
|
|
@ -10092,8 +10092,10 @@ void ImFont::RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_re
|
|||
{
|
||||
// Clipping on Y is more likely
|
||||
float y1 = (float)(y + glyph->YOffset * scale);
|
||||
if (y1 > clip_rect.w)
|
||||
break;
|
||||
float y2 = (float)(y1 + glyph->Height * scale);
|
||||
if (y1 <= clip_rect.w && y2 >= clip_rect.y) // FIMXE-OPT: could fast-forward until next line
|
||||
if (y2 >= clip_rect.y) // FIMXE-OPT: could fast-forward until next line (without breaking word-wrapping)
|
||||
{
|
||||
float x1 = (float)(x + glyph->XOffset * scale);
|
||||
float x2 = (float)(x1 + glyph->Width * scale);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue