diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index a58b03b6b..da5b2a697 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -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 diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 91f0d0f61..3d3d1f008 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -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) {