Internals: alter ImGuiInputFlags values to leave room + indent.

This commit is contained in:
ocornut
2024-01-08 18:49:19 +01:00
parent f1ae47c4b9
commit 58261dbe9a
2 changed files with 17 additions and 16 deletions

View File

@ -8427,7 +8427,7 @@ bool ImGui::IsKeyPressed(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags)
IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByIsKeyPressed) == 0); // Passing flags not supported by this function!
bool pressed = (t == 0.0f);
if (!pressed && ((flags & ImGuiInputFlags_Repeat) != 0))
if (!pressed && (flags & ImGuiInputFlags_Repeat) != 0)
{
float repeat_delay, repeat_rate;
GetTypematicRepeatRate(flags, &repeat_delay, &repeat_rate);
@ -9300,7 +9300,7 @@ bool ImGui::IsKeyChordPressed(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiIn
ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_);
if (key == ImGuiKey_None)
key = ConvertSingleModFlagToKey(&g, mods);
if (!IsKeyPressed(key, owner_id, (flags & (ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_))))
if (!IsKeyPressed(key, owner_id, (flags & ImGuiInputFlags_RepeatMask_)))
return false;
return true;
}