mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-07 21:39:54 +02:00
InputFloat, SliderFloat, DragFloat: always turn both '.' and ',' into the current decimal point character. (#6719, #2278)
This commit is contained in:
@ -3948,6 +3948,9 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
|
||||
// Users of non-default decimal point (in particular ',') may be affected by word-selection logic (is_word_boundary_from_right/is_word_boundary_from_left) functions.
|
||||
ImGuiContext& g = *GImGui;
|
||||
const unsigned c_decimal_point = (unsigned int)g.PlatformLocaleDecimalPoint;
|
||||
if (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsScientific))
|
||||
if (c == '.' || c == ',')
|
||||
c = c_decimal_point;
|
||||
|
||||
// Full-width -> half-width conversion for numeric fields (https://en.wikipedia.org/wiki/Halfwidth_and_Fullwidth_Forms_(Unicode_block)
|
||||
// While this is mostly convenient, this has the side-effect for uninformed users accidentally inputting full-width characters that they may
|
||||
|
Reference in New Issue
Block a user