mirror of
https://github.com/Drezil/imgui.git
synced 2025-03-30 07:52:45 +00:00
Fixed a bug with TextUnformatted() clipping of long text (#257)
This commit is contained in:
parent
0e5b64ecd2
commit
57f70a29b2
@ -4934,11 +4934,11 @@ void ImGui::TextUnformatted(const char* text, const char* text_end)
|
|||||||
// Lines to skip (can't skip when logging text)
|
// Lines to skip (can't skip when logging text)
|
||||||
if (!g.LogEnabled)
|
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)
|
if (lines_skippable > 0)
|
||||||
{
|
{
|
||||||
int lines_skipped = 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');
|
const char* line_end = strchr(line, '\n');
|
||||||
line = line_end + 1;
|
line = line_end + 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user