mirror of
https://github.com/gwm17/implot.git
synced 2024-11-13 22:48:50 -05:00
make pie plots respond to fits
This commit is contained in:
parent
e9469cf347
commit
ab24f756fa
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user