DrawList: added better handling for rendering degenerate geometry. (2183, 7972)

- Add ImDrawFlags_MiterOnly which is used to indicate that a path contains simple geometry and can be rendered using mitered corners
- Added handling of degenerated shapes for stroked rectangle, circle, ngon, and ellipse
- Render shapes filled when outline covers the whole shape
- Clamp very small circles and ngons, and use alpha fade below one pixel
- Added correct offset for ellipse
This commit is contained in:
Mikko Mononen
2026-04-21 15:28:20 +03:00
committed by ocornut
parent ce44b4e8be
commit b097a7bd33
3 changed files with 200 additions and 70 deletions

View File

@@ -10418,7 +10418,7 @@ static void ShowExampleAppCustomRendering(bool* p_open)
static bool curve_segments_override = false;
static int curve_segments_override_v = 8;
static ImVec4 colf = ImVec4(1.0f, 1.0f, 0.4f, 1.0f);
ImGui::DragFloat("Size", &sz, 0.2f, 2.0f, 100.0f, "%.0f");
ImGui::DragFloat("Size", &sz, 0.2f, 0.2f, 100.0f, "%.0f");
ImGui::DragFloat("Thickness", &thickness, 0.05f, 0.0f, 32.0f, "%.02f");
ImGui::SliderInt("N-gon sides", &ngon_sides, 3, 12);
ImGui::Checkbox("##circlesegmentoverride", &circle_segments_override);