From ab24f756fa83eaedcbc19bb8c6fbf4288662b8c7 Mon Sep 17 00:00:00 2001 From: Evan Pezent Date: Wed, 9 Jun 2021 11:26:54 -0700 Subject: [PATCH] make pie plots respond to fits --- implot_items.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/implot_items.cpp b/implot_items.cpp index 3923d14..332cf12 100644 --- a/implot_items.cpp +++ b/implot_items.cpp @@ -1730,6 +1730,10 @@ void PlotPieChart(const char* const label_ids[], const T* values, int count, dou double percent = normalize ? (double)values[i] / sum : (double)values[i]; a1 = a0 + 2 * IM_PI * percent; if (BeginItem(label_ids[i])) { + if (FitThisFrame()) { + FitPoint(ImPlotPoint(x-radius,y-radius)); + FitPoint(ImPlotPoint(x+radius,y+radius)); + } ImU32 col = GetCurrentItem()->Color; if (percent < 0.5) { RenderPieSlice(DrawList, center, radius, a0, a1, col);