From a9df6bfe86858d92f387bc40e9419ba30d7065c1 Mon Sep 17 00:00:00 2001 From: omar Date: Thu, 27 Jul 2017 14:04:58 +0800 Subject: [PATCH] ColorButton: Fixed rounding corners artefact when there is a single cell. --- imgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index cefc3d99..38aa33aa 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -9054,8 +9054,8 @@ void ImGui::RenderColorRectWithAlphaCheckerboard(ImVec2 p_min, ImVec2 p_max, ImU for (int x_i = (y_i & 1) ^ 1; x_i < x_count; x_i += 2) { int rounding_corners_flags = 0; - if (y_i == 0) rounding_corners_flags |= (x_i == 0) ? ImGuiCorner_TopLeft : (x_i == x_count-1) ? ImGuiCorner_TopRight : 0; - if (y_i == y_count-1) rounding_corners_flags |= (x_i == 0) ? ImGuiCorner_BottomLeft : (x_i == x_count-1) ? ImGuiCorner_BottomRight : 0; + if (y_i == 0) { if (x_i == 0) rounding_corners_flags |= ImGuiCorner_TopLeft; if (x_i == x_count-1) rounding_corners_flags |= ImGuiCorner_TopRight; } + if (y_i == y_count-1) { if (x_i == 0) rounding_corners_flags |= ImGuiCorner_BottomLeft; if (x_i == x_count-1) rounding_corners_flags |= ImGuiCorner_BottomRight; } rounding_corners_flags &= rounding_corners_flags_parent; ImVec2 p1(p_min.x + x_i * grid_step, p_min.y + y_i * grid_step); ImVec2 p2(ImMin(p1.x + grid_step, p_max.x), ImMin(p1.y + grid_step, p_max.y));