From fd752d8357d1f928265b275a293a6bc1adcfe6f7 Mon Sep 17 00:00:00 2001 From: ocornut Date: Fri, 13 Mar 2026 16:32:39 +0100 Subject: [PATCH] InputText: Fixed a glitch when using ImGuiInputTextFlags_ElideLeft where the local x offset would be incorrect during the deactivation frame. (#9298) --- docs/CHANGELOG.txt | 2 ++ imgui_widgets.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 0cff41294..255d809b4 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -85,6 +85,8 @@ Other Changes: - Reworked io.ConfigInputTextEnterKeepActive mode so that pressing Enter will deactivate/reactivate the item in order for e.g. IsItemDeactivatedAfterEdit() signals to be emitted the same way regardless of that setting. (#9001, #9115) + - Fixed a glitch when using ImGuiInputTextFlags_ElideLeft where the local x offset + would be incorrect during the deactivation frame. (#9298) - Style: - Border sizes are now scaled (and rounded) by ScaleAllSizes(). - When using large values with ScallAllSizes(), the following items thickness diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 7395fad64..1bc875f63 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -5568,7 +5568,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ } // Find render position for right alignment (single-line only) - if (g.ActiveId != id && flags & ImGuiInputTextFlags_ElideLeft) + if (g.ActiveId != id && (flags & ImGuiInputTextFlags_ElideLeft) && !render_cursor && !render_selection) draw_pos.x = ImMin(draw_pos.x, frame_bb.Max.x - CalcTextSize(buf_display, NULL).x - style.FramePadding.x); //draw_scroll.x = state->Scroll.x; // Preserve scroll when inactive?