DrawList: debug build optimizations.

- changed truncated tests to use macro, and inline the computation in debug builds (~15% was spent on calling the functions)
- inlined the common rectangle cases in AddRect() for debug build speed up
This commit is contained in:
Mikko Mononen
2026-06-01 20:35:16 +03:00
committed by ocornut
parent e0530d81e1
commit ed6f9fcfd1
2 changed files with 42 additions and 15 deletions

View File

@@ -10423,7 +10423,7 @@ static void ShowExampleAppCustomRendering(bool* p_open)
ImGui::DragFloat("Size", &sz, 0.2f, 0.2f, 100.0f, "%.0f");
const float thickness_anim_period = 5.f;
const float thickness_anim_period = 5.0f;
const float thickness_wave = 1.0f - fabsf(fmodf((float)ImGui::GetTime(), thickness_anim_period) * (2.0f / thickness_anim_period) - 1.0f);
const float thickness = animate_thickness ? thickness_wave * base_thickness : base_thickness;
ImGui::DragFloat("Thickness", &base_thickness, 0.02f, 0.0f, 30.0f, "%.02f");