From 507a87354b8984fe593094e15db34c939e60c95f Mon Sep 17 00:00:00 2001 From: thedmd Date: Fri, 13 May 2022 17:20:37 +0200 Subject: [PATCH] DrawList: Circles disappear when using a radius < 0.5f (#3491) Amend 051ce0765ef8569729c9ae9b3d466132f9010b89 --- docs/CHANGELOG.txt | 1 + imgui_draw.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index be48e9df..9d16c4c2 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -88,6 +88,7 @@ Other Changes: - DrawList: Fixed PathArcTo() emitting terminating vertices too close to arc vertices. (#4993) [@thedmd] - DrawList: Fixed texture-based anti-aliasing path with RGBA textures (#5132, #3245) [@cfillion] - DrawList: Fixed divide-by-zero or glitches with Radius/Rounding values close to zero. (#5249, #5293, #3491) +- DrawList: Circle with a radius smaller than 0.5f won't appear, to be consistent with other primitives. [@thedmd] - Debug: Added DebugTextEncoding() function to facilitate diagnosing issues when not sure about whether you have a UTF-8 text encoding issue or a font loading issue. [@LaMarche05, @ocornut] - Metrics: Added a "UTF-8 Encoding Viewer" section using the aforementioned DebugTextEncoding() function. diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 6fefe2dd..0823b01e 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -1482,7 +1482,7 @@ void ImDrawList::AddTriangleFilled(const ImVec2& p1, const ImVec2& p2, const ImV void ImDrawList::AddCircle(const ImVec2& center, float radius, ImU32 col, int num_segments, float thickness) { - if ((col & IM_COL32_A_MASK) == 0 || radius <= 0.0f) + if ((col & IM_COL32_A_MASK) == 0 || radius < 0.5f) return; if (num_segments <= 0) @@ -1506,7 +1506,7 @@ void ImDrawList::AddCircle(const ImVec2& center, float radius, ImU32 col, int nu void ImDrawList::AddCircleFilled(const ImVec2& center, float radius, ImU32 col, int num_segments) { - if ((col & IM_COL32_A_MASK) == 0 || radius <= 0.0f) + if ((col & IM_COL32_A_MASK) == 0 || radius < 0.5f) return; if (num_segments <= 0)