From 32be6c064b9036341fd36e7c34a11f2dc4104f6c Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 25 Aug 2020 20:08:24 +0200 Subject: [PATCH] InputText: Fixed using ImGuiInputTextFlags_Password with InputTextMultiline(). (#3427, #3428) --- docs/CHANGELOG.txt | 2 ++ imgui_widgets.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 573b813a2b97..156a54c29fef 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -41,6 +41,8 @@ Other Changes: - InputText: Added ImGuiInputTextFlags_CallbackEdit to modify internally owned buffer after an edit. (note that InputText() already returns true on edit, the callback is useful mainly to manipulate the underlying buffer while focus is active). +- InputText: Fixed using ImGuiInputTextFlags_Password with InputTextMultiline(). (#3427, #3428) + It is a rather unusual or useless combination of features but no reason it shouldn't work! - DragFloat, DragScalar: Fixed ImGuiSliderFlags_ClampOnInput not being honored in the special case where v_min == v_max. (#3361) - BeginMenuBar: Fixed minor bug where CursorPosMax gets pushed to CursorPos prior to calling BeginMenuBar(), diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 2ee4c1914d41..59fa0918283d 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -4505,6 +4505,9 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ } } + if (is_password && !is_displaying_hint) + PopFont(); + if (is_multiline) { Dummy(text_size + ImVec2(0.0f, g.FontSize)); // Always add room to scroll an extra line @@ -4512,9 +4515,6 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ EndGroup(); } - if (is_password && !is_displaying_hint) - PopFont(); - // Log as text if (g.LogEnabled && (!is_password || is_displaying_hint)) LogRenderedText(&draw_pos, buf_display, buf_display_end);