1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-11-22 18:28:53 -05:00

revert OffsetAndStride

This commit is contained in:
Evan Pezent 2021-07-09 20:22:21 -07:00
parent 51930a5ae6
commit bffd448207
2 changed files with 3 additions and 1 deletions

View File

@ -537,6 +537,8 @@ template <typename T> IMPLOT_API void PlotBarsH(const char* label_id, const T* v
template <typename T> IMPLOT_API void PlotBarsH(const char* label_id, const T* xs, const T* ys, int count, double height, int offset=0, int stride=sizeof(T));
IMPLOT_API void PlotBarsHG(const char* label_id, ImPlotPoint (*getter)(void* data, int idx), void* data, int count, double height, int offset=0);
// Plots vertical error bar. The label_id should be the same as the label_id of the associated line or bar plot.
template <typename T> IMPLOT_API void PlotErrorBars(const char* label_id, const T* xs, const T* ys, const T* err, int count, int offset=0, int stride=sizeof(T));
template <typename T> IMPLOT_API void PlotErrorBars(const char* label_id, const T* xs, const T* ys, const T* neg, const T* pos, int count, int offset=0, int stride=sizeof(T));

View File

@ -1270,7 +1270,7 @@ void FillRange(ImVector<T>& buffer, int n, T vmin, T vmax) {
// Offsets and strides a data buffer
template <typename T>
static inline T OffsetAndStride(const T* data, int idx, int , int , int stride) {
// idx = ImPosMod(offset + idx, count);
idx = ImPosMod(offset + idx, count);
return *(const T*)(const void*)((const unsigned char*)data + (size_t)idx * stride);
}