mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-18 14:16:36 +00:00
InputText: Fixed returning true when edition is cancelled with Esc and the current buffer matches the initial value.
This commit is contained in:
parent
28edece04f
commit
101f9b42b7
@ -56,6 +56,7 @@ Other Changes:
|
||||
- MenuBar: Made BeginMainMenuBar() honor style.DisplaySafeAreaPadding so the text can be made visible on TV settings that don't display all pixels. (#1439) [@dougbinks]
|
||||
- InputText: On Mac OS X, filter out characters when the Cmd modifier is held. (#1747) [@sivu]
|
||||
- InputText: On Mac OS X, support Cmd+Shift+Z for Redo. Cmd+Y is also supported as major apps seems to default to support both. (#1765) [@lfnoise]
|
||||
- InputText: Fixed returning true when edition is cancelled with Esc and the current buffer matches the initial value.
|
||||
- Style: Changed default style.DisplaySafeAreaPadding values from (4,4) to (3,3) so it is smaller than FramePadding and has no effect on main menu bar on a computer. (#1439)
|
||||
- Misc: Added IMGUI_CHECKVERSION() macro to compare version string and data structure sizes in order to catch issues with mismatching compilation unit settings. (#1695, #1769)
|
||||
- Demo: Fixed Overlay: Added a context menu item to enable freely moving the window.
|
||||
|
@ -10245,8 +10245,8 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2
|
||||
{
|
||||
if (cancel_edit)
|
||||
{
|
||||
// Restore initial value
|
||||
if (is_editable)
|
||||
// Restore initial value. Only return true if restoring to the initial value changes the current buffer contents.
|
||||
if (is_editable && strncmp(buf, edit_state.InitialText.Data, buf_size) != 0)
|
||||
{
|
||||
ImStrncpy(buf, edit_state.InitialText.Data, buf_size);
|
||||
value_changed = true;
|
||||
|
Loading…
Reference in New Issue
Block a user