Fix: long TextUnformatted (>2000 bytes) rendered each visible line to the end of the text (RenderText end was nil, upstream passes line_end); PushFont() saved the new font instead of the current one, so PopFont() never restored it (font preview leaked into all later text); t_fixes covers both

This commit is contained in:
4DBug committed 2026-10-15 10:54:56 -05:00
1 parent a43b488225
commit efb7db544c
5 files changed
+28 -8

No files matched your search

+2 -2
View File
@@ -5512,7 +5512,7 @@ function ImGui.PushFont(font, font_size_base)
assert(font ~= nil)
assert(font_size_base >= 0.0)
g.FontStack:push_back(ImFontStackData(font, g.FontSizeBase, g.FontSize))
g.FontStack:push_back(ImFontStackData(g.Font, g.FontSizeBase, g.FontSize))
if font_size_base == 0.0 then
font_size_base = g.FontSizeBase -- Keep current font size
@@ -63145,7 +63145,7 @@ function ImGui.TextEx(text, text_end, flags)
local line_size = ImGui.CalcTextSizeEx(text, line, line_end)
text_size.x = ImMax(text_size.x, line_size.x)
ImGui.RenderText(pos, text, line, nil, false)
ImGui.RenderText(pos, text, line, line_end, false)
line = line_end + 1
line_rect.Min.y = line_rect.Min.y + line_height
line_rect.Max.y = line_rect.Max.y + line_height
+2 -2
View File
@@ -5649,7 +5649,7 @@ function ImGui.PushFont(font, font_size_base)
assert(font ~= nil)
assert(font_size_base >= 0.0)
g.FontStack:push_back(ImFontStackData(font, g.FontSizeBase, g.FontSize))
g.FontStack:push_back(ImFontStackData(g.Font, g.FontSizeBase, g.FontSize))
if font_size_base == 0.0 then
font_size_base = g.FontSizeBase -- Keep current font size
@@ -55771,7 +55771,7 @@ function ImGui.TextEx(text, text_end, flags)
local line_size = ImGui.CalcTextSizeEx(text, line, line_end)
text_size.x = ImMax(text_size.x, line_size.x)
ImGui.RenderText(pos, text, line, nil, false)
ImGui.RenderText(pos, text, line, line_end, false)
line = line_end + 1
line_rect.Min.y = line_rect.Min.y + line_height
line_rect.Max.y = line_rect.Max.y + line_height