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:
parent
c0da6fea04
commit
4fcc6e01ac
|
@ -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];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user