Skip to content

Commit fd752d8

Browse files
committed
InputText: Fixed a glitch when using ImGuiInputTextFlags_ElideLeft where the local x offset would be incorrect during the deactivation frame. (#9298)
1 parent d02c645 commit fd752d8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/CHANGELOG.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ Other Changes:
8585
- Reworked io.ConfigInputTextEnterKeepActive mode so that pressing Enter will
8686
deactivate/reactivate the item in order for e.g. IsItemDeactivatedAfterEdit()
8787
signals to be emitted the same way regardless of that setting. (#9001, #9115)
88+
- Fixed a glitch when using ImGuiInputTextFlags_ElideLeft where the local x offset
89+
would be incorrect during the deactivation frame. (#9298)
8890
- Style:
8991
- Border sizes are now scaled (and rounded) by ScaleAllSizes().
9092
- When using large values with ScallAllSizes(), the following items thickness

imgui_widgets.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5568,7 +5568,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
55685568
}
55695569

55705570
// Find render position for right alignment (single-line only)
5571-
if (g.ActiveId != id && flags & ImGuiInputTextFlags_ElideLeft)
5571+
if (g.ActiveId != id && (flags & ImGuiInputTextFlags_ElideLeft) && !render_cursor && !render_selection)
55725572
draw_pos.x = ImMin(draw_pos.x, frame_bb.Max.x - CalcTextSize(buf_display, NULL).x - style.FramePadding.x);
55735573
//draw_scroll.x = state->Scroll.x; // Preserve scroll when inactive?
55745574

0 commit comments

Comments
 (0)