ColorPicker: Fixed saturation/value cursor radius not scaling properly.

+ Misc docs/comments.
This commit is contained in:
ocornut
2024-01-05 17:23:42 +01:00
parent 27e83c2953
commit 7f9533b840
3 changed files with 9 additions and 6 deletions

View File

@ -8721,7 +8721,9 @@ static void ImGui::UpdateKeyboardInputs()
GetKeyData(ImGuiMod_Super)->Down = io.KeySuper;
}
}
#endif
// Import legacy ImGuiNavInput_ io inputs and convert to gamepad keys
#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
const bool nav_gamepad_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (io.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0;
if (io.BackendUsingLegacyNavInputArray && nav_gamepad_active)
@ -8744,7 +8746,6 @@ static void ImGui::UpdateKeyboardInputs()
MAP_LEGACY_NAV_INPUT_TO_KEY1(ImGuiKey_GamepadLStickDown, ImGuiNavInput_LStickDown);
#undef NAV_MAP_KEY
}
#endif
#endif
// Update aliases
@ -8753,7 +8754,7 @@ static void ImGui::UpdateKeyboardInputs()
UpdateAliasKey(ImGuiKey_MouseWheelX, io.MouseWheelH != 0.0f, io.MouseWheelH);
UpdateAliasKey(ImGuiKey_MouseWheelY, io.MouseWheel != 0.0f, io.MouseWheel);
// Synchronize io.KeyMods and io.KeyXXX values.
// Synchronize io.KeyMods and io.KeyCtrl/io.KeyShift/etc. values.
// - New backends (1.87+): send io.AddKeyEvent(ImGuiMod_XXX) -> -> (here) deriving io.KeyMods + io.KeyXXX from key array.
// - Legacy backends: set io.KeyXXX bools -> (above) set key array from io.KeyXXX -> (here) deriving io.KeyMods + io.KeyXXX from key array.
// So with legacy backends the 4 values will do a unnecessary back-and-forth but it makes the code simpler and future facing.
@ -8790,6 +8791,7 @@ static void ImGui::UpdateKeyboardInputs()
owner_data->LockThisFrame = owner_data->LockUntilRelease = owner_data->LockUntilRelease && key_data->Down; // Clear LockUntilRelease when key is not Down anymore
}
// Update key routing (for e.g. shortcuts)
UpdateKeyRoutingTable(&g.KeysRoutingTable);
}