From 8be0723fb7a626f0fad6e70a2ad9139e442c4008 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 13 Nov 2024 16:55:06 +0100 Subject: [PATCH] Amend Changelog to better document how changing button behavior of InputInt/InputFloat step buttons affected some mis-uses (#8149) --- docs/CHANGELOG.txt | 5 +++++ imgui.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 6586cba20..0dc526e24 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -76,6 +76,11 @@ Other changes: between _Header and _HeaderHovered which was introduced v1.91 (#8106, #1861) - Buttons: using ImGuiItemFlags_ButtonRepeat makes default button behavior use PressedOnClick instead of PressedOnClickRelease when unspecified. + - This is intended to make the +/- buttons of InputInt/InputFloat react on the + initial mouse down event. + - Note that it may reveal incorrect usage if you were using InputInt/InputFloat + without persistent storage by relying solely on e.g. IsItemDeactivatedAfterEdit(): + this was never supported and didn't work consistantly (see #8149). - InputText: fixed a bug (regression in 1.91.2) where modifying text buffer within a callback would sometimes prevents further appending to the buffer. - Tabs, Style: made ImGuiCol_TabDimmedSelectedOverline alpha 0 (not visible) in default diff --git a/imgui.cpp b/imgui.cpp index 45af644ae..3512ec87d 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -5788,7 +5788,7 @@ bool ImGui::IsItemDeactivatedAfterEdit() return IsItemDeactivated() && (g.ActiveIdPreviousFrameHasBeenEditedBefore || (g.ActiveId == 0 && g.ActiveIdHasBeenEditedBefore)); } -// == GetItemID() == GetFocusID() +// == (GetItemID() == GetFocusID() && GetFocusID() != 0) bool ImGui::IsItemFocused() { ImGuiContext& g = *GImGui;