Skip to content

Commit 325563a

Browse files
committed
InputTextMultiline: InputTextMultiline: fixed an issue calculating lines count when active.
Amend 4252275
1 parent 763db04 commit 325563a

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

docs/CHANGELOG.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ Other Changes:
8484
- Fixed selection highlight Y1 offset being very slightly off (since 1.92.3). (#9311) [@v-ein]
8585
- InputTextMultiline: fixed an issue introduced in 1.92.3 where line count calculated
8686
for vertical scrollbar range would be +1 when the widget is inactive, word-wrap is
87-
disabled and the text buffer ends with '\n'.
87+
disabled and the text buffer ends with '\n'. Fixed a similar issue related to clipping
88+
large amount of text.
8889
- Style:
8990
- Border sizes are now scaled (and rounded) by ScaleAllSizes().
9091
- When using large values with ScallAllSizes(), the following items thickness

imgui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5565,7 +5565,7 @@ void ImGui::NewFrame()
55655565
// As a result, custom widget using ButtonBehavior() _without_ ItemAdd() need to call KeepAliveID() themselves.
55665566
if (g.ActiveId != 0 && g.ActiveIdIsAlive != g.ActiveId && g.ActiveIdPreviousFrame == g.ActiveId)
55675567
{
5568-
IMGUI_DEBUG_LOG_ACTIVEID("NewFrame(): ClearActiveID() because it isn't marked alive anymore!\n");
5568+
IMGUI_DEBUG_LOG_ACTIVEID("NewFrame(): ClearActiveID() 0x%08X because it isn't marked alive anymore!\n", g.ActiveId);
55695569
ClearActiveID();
55705570
}
55715571

imgui_widgets.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4629,11 +4629,8 @@ static int InputTextLineIndexBuild(ImGuiInputTextFlags flags, ImGuiTextIndex* li
46294629
line_index->Offsets.push_back(0);
46304630
size++;
46314631
}
4632-
if (buf_end > buf && buf_end[-1] == '\n' && size <= max_output_buffer_size && !trailing_line_already_counted)
4633-
{
4632+
if (buf_end > buf && buf_end[-1] == '\n' && !trailing_line_already_counted && size++ <= max_output_buffer_size)
46344633
line_index->Offsets.push_back((int)(buf_end - buf));
4635-
size++;
4636-
}
46374634
return size;
46384635
}
46394636

0 commit comments

Comments
 (0)