1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-11-26 20:28:50 -05:00

fix compiler warnings for plot digital

This commit is contained in:
Evan Pezent 2020-06-15 21:35:09 -05:00
parent a3defa4881
commit 37ee2d4c54

View File

@ -3293,7 +3293,7 @@ void PlotHeatmap(const char* label_id, const double* values, int rows, int cols,
//-----------------------------------------------------------------------------
template <typename Getter>
inline void PlotDigitalEx(const char* label_id, Getter getter, int count, int offset)
inline void PlotDigitalEx(const char* label_id, Getter getter)
{
IM_ASSERT_USER_ERROR(gp.CurrentPlot != NULL, "PlotDigital() needs to be called between BeginPlot() and EndPlot()!");
@ -3304,12 +3304,10 @@ inline void PlotDigitalEx(const char* label_id, Getter getter, int count, int of
// render digital signals as "pixel bases" rectangles
PushPlotClipRect();
if (count > 1 && WillLineRender()) {
if (getter.Count > 1 && WillLineRender()) {
ImDrawList & DrawList = *ImGui::GetWindowDrawList();
const float line_weight = item->Highlight ? gp.Style.LineWeight * 2 : gp.Style.LineWeight;
const int y_axis = gp.CurrentPlot->CurrentYAxis;
const int segments = count - 1;
int i1 = offset;
int pixYMax = 0;
ImPlotPoint itemData1 = getter(0);
for (int i = 0; i < getter.Count; ++i) {
@ -3362,7 +3360,7 @@ inline void PlotDigitalEx(const char* label_id, Getter getter, int count, int of
void PlotDigital(const char* label_id, const float* xs, const float* ys, int count, int offset, int stride) {
GetterXsYs<float> getter(xs,ys,count,offset,stride);
return PlotDigitalEx(label_id, getter, count, offset);
return PlotDigitalEx(label_id, getter);
}
//-----------------------------------------------------------------------------
@ -3370,7 +3368,7 @@ void PlotDigital(const char* label_id, const float* xs, const float* ys, int cou
void PlotDigital(const char* label_id, const double* xs, const double* ys, int count, int offset, int stride) {
GetterXsYs<double> getter(xs,ys,count,offset,stride);
return PlotDigitalEx(label_id, getter, count, offset);
return PlotDigitalEx(label_id, getter);
}
//-----------------------------------------------------------------------------
@ -3378,7 +3376,7 @@ void PlotDigital(const char* label_id, const double* xs, const double* ys, int c
void PlotDigital(const char* label_id, ImPlotPoint (*getter_func)(void* data, int idx), void* data, int count, int offset) {
GetterFuncPtrImPlotPoint getter(getter_func,data,count,offset);
return PlotDigitalEx(label_id, getter, count, offset);
return PlotDigitalEx(label_id, getter);
}
//-----------------------------------------------------------------------------