mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-07 13:35:49 +02:00
This commit is contained in:
committed by
ocornut
parent
b380d3abe3
commit
7e9e1ff1c2
@ -3842,6 +3842,7 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
|
||||
unsigned int c = *p_char;
|
||||
|
||||
// Filter non-printable (NB: isprint is unreliable! see #2467)
|
||||
bool apply_named_filters = true;
|
||||
if (c < 0x20)
|
||||
{
|
||||
bool pass = false;
|
||||
@ -3849,6 +3850,7 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
|
||||
pass |= (c == '\t' && (flags & ImGuiInputTextFlags_AllowTabInput));
|
||||
if (!pass)
|
||||
return false;
|
||||
apply_named_filters = false; // Override named filters below so newline and tabs can still be inserted.
|
||||
}
|
||||
|
||||
if (input_source != ImGuiInputSource_Clipboard)
|
||||
@ -3867,7 +3869,7 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
|
||||
return false;
|
||||
|
||||
// Generic named filters
|
||||
if (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase | ImGuiInputTextFlags_CharsNoBlank | ImGuiInputTextFlags_CharsScientific))
|
||||
if (apply_named_filters && (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase | ImGuiInputTextFlags_CharsNoBlank | ImGuiInputTextFlags_CharsScientific)))
|
||||
{
|
||||
// The libc allows overriding locale, with e.g. 'setlocale(LC_NUMERIC, "de_DE.UTF-8");' which affect the output/input of printf/scanf.
|
||||
// The standard mandate that programs starts in the "C" locale where the decimal point is '.'.
|
||||
|
Reference in New Issue
Block a user