Skip to content

Commit 5393be8

Browse files
committed
docs: plot polygon method description
1 parent 57e7ccd commit 5393be8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

implot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ IMPLOT_API void PlotScatterG(const char* label_id, ImPlotGetter getter, void* da
967967
IMPLOT_TMP void PlotBubbles(const char* label_id, const T* values, const T* szs, int count, double xscale=1, double xstart=0, const ImPlotSpec& spec=ImPlotSpec());
968968
IMPLOT_TMP void PlotBubbles(const char* label_id, const T* xs, const T* ys, const T* szs, int count, const ImPlotSpec& spec=ImPlotSpec());
969969

970-
// Plots a polygon. Points are specified as separate x and y arrays. Supports both convex and concave polygons.
970+
// Plots a polygon. Points are specified in counter-clockwise order. If concave, make sure to set the Concave flag.
971971
IMPLOT_TMP void PlotPolygon(const char* label_id, const T* xs, const T* ys, int count, const ImPlotSpec& spec=ImPlotSpec());
972972

973973
// Plots a a stairstep graph. The y value is continued constantly to the right from every x position, i.e. the interval [x[i], x[i+1]) has the value y[i]

implot_items.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1959,7 +1959,7 @@ void PlotPolygonEx(const char* label_id, const Getter& getter, const ImPlotSpec&
19591959
const ImPlotAxis& y_axis = GetCurrentPlot()->Axes[GetCurrentPlot()->CurrentY];
19601960
Transformer2 transformer(x_axis, y_axis);
19611961

1962-
// Flip points to make sure they are in clockwise order for correct filling when one axis is inverted
1962+
// Flip points to make sure they are in counter-clockwise order for correct filling when one axis is inverted
19631963
bool x_inv = ImHasFlag(x_axis.Flags, ImPlotAxisFlags_Invert);
19641964
bool y_inv = ImHasFlag(y_axis.Flags, ImPlotAxisFlags_Invert);
19651965
bool flip = !((x_inv ? 1 : 0) ^ (y_inv ? 1 : 0));

0 commit comments

Comments
 (0)