Checkbox: indeterminate/mixed value inner rectangle never has rounding, to reduce confusion with a radio button. (#5518, #5677, #6865, #2644)

Amend 2a3517a3998
This commit is contained in:
ocornut 2026-11-09 13:10:56 +01:00
parent 135a923659
commit 022499b0ce
2 changed files with 5 additions and 2 deletions

View File

@ -98,6 +98,8 @@ Other Changes:
end of storage when trailing items are unselected (#9604) [@MilosLord]
- Drags: fixed handling of `ImGuiSliderFlags_WrapAround`: value could temporarily
escape the range when dragging fast. (#9612, #9611, #7749) [@swayie, @ocornut]
- Checkbox: indeterminate/mixed value inner rectangle never has rounding,
to reduce confusion with a radio button. (#5518, #5677, #6865, #2644)
- ColorEdit:
- ColorButton, ColorEdit, ColorPicker: fixed an issue rendering colors when
inside a `BeginDisabled(false)` block, caused by the alpha cancelling-out

View File

@ -1299,8 +1299,9 @@ bool ImGui::Checkbox(const char* label, bool* v)
{
// Undocumented tristate/mixed/indeterminate checkbox (#2644)
// This may seem awkwardly designed because the aim is to make ImGuiItemFlags_MixedValue supported by all widgets (not just checkbox)
ImVec2 pad(ImMax(1.0f, IM_TRUNC(square_sz / 3.6f)), ImMax(1.0f, IM_TRUNC(square_sz / 3.6f)));
window->DrawList->AddRectFilled(check_bb.Min + pad, check_bb.Max - pad, check_col, style.FrameRounding);
const float pad = ImMax(1.0f, IM_TRUNC(square_sz / 3.6f));
const float rounding = 0.0f;// IM_TRUNC(ImMin((square_sz - pad * 2.0f) * 0.20f, style.FrameRounding)); // Clamp rounding
window->DrawList->AddRectFilled(check_bb.Min + ImVec2(pad, pad), check_bb.Max - ImVec2(pad, pad), check_col, rounding);
}
else if (*v)
{