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

fix sizeof(T) in IndexData

This commit is contained in:
Evan Pezent 2021-12-02 20:54:54 -08:00
parent c0da6fea04
commit 4fcc6e01ac

View File

@ -293,7 +293,7 @@ void EndItem() {
// Offsets and strides a data buffer // Offsets and strides a data buffer
template <typename T> template <typename T>
IMPLOT_INLINE T IndexData(const T* data, int idx, int count, int offset, int stride) { IMPLOT_INLINE T IndexData(const T* data, int idx, int count, int offset, int stride) {
const int s = ((offset == 0) << 0) | ((stride == sizeof(float)) << 1); const int s = ((offset == 0) << 0) | ((stride == sizeof(T)) << 1);
switch (s) { switch (s) {
case 3 : return data[idx]; case 3 : return data[idx];
case 2 : return data[(offset + idx) % count]; case 2 : return data[(offset + idx) % count];