From 1af5884e8086e78308042b125807220dc730c597 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 11 Sep 2024 14:07:57 +0200 Subject: [PATCH] InputText: amends: fixes character filtering. --- imgui_widgets.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 4fc47872ec27..b5c69e73eb06 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -4854,11 +4854,11 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ { unsigned int c; int len = ImTextCharFromUtf8(&c, s, NULL); + s += len; if (!InputTextFilterCharacter(&g, &c, flags, callback, callback_user_data, true)) continue; - memcpy(clipboard_filtered + clipboard_filtered_len, s, len); + memcpy(clipboard_filtered + clipboard_filtered_len, s - len, len); clipboard_filtered_len += len; - s += len; } clipboard_filtered[clipboard_filtered_len] = 0; if (clipboard_filtered_len > 0) // If everything was filtered, ignore the pasting operation