mirror of
https://github.com/gwm17/implot.git
synced 2025-04-22 00:18:49 -04:00
Fix divison by zero when plotting 0 data lenght.
This commit is contained in:
parent
4d4cac629b
commit
e43be28452
12
implot.cpp
12
implot.cpp
|
@ -2059,7 +2059,7 @@ struct GetterYs {
|
||||||
GetterYs(const T* ys, int count, int offset, int stride) {
|
GetterYs(const T* ys, int count, int offset, int stride) {
|
||||||
Ys = ys;
|
Ys = ys;
|
||||||
Count = count;
|
Count = count;
|
||||||
Offset = PosMod(offset, count);;
|
Offset = count ? PosMod(offset, count) : 0;
|
||||||
Stride = stride;
|
Stride = stride;
|
||||||
}
|
}
|
||||||
const T* Ys;
|
const T* Ys;
|
||||||
|
@ -2076,7 +2076,7 @@ struct GetterXsYs {
|
||||||
GetterXsYs(const T* xs, const T* ys, int count, int offset, int stride) {
|
GetterXsYs(const T* xs, const T* ys, int count, int offset, int stride) {
|
||||||
Xs = xs; Ys = ys;
|
Xs = xs; Ys = ys;
|
||||||
Count = count;
|
Count = count;
|
||||||
Offset = PosMod(offset, count);;
|
Offset = count ? PosMod(offset, count) : 0;
|
||||||
Stride = stride;
|
Stride = stride;
|
||||||
}
|
}
|
||||||
const T* Xs;
|
const T* Xs;
|
||||||
|
@ -2095,7 +2095,7 @@ struct GetterXsYRef {
|
||||||
Xs = xs;
|
Xs = xs;
|
||||||
YRef = y_ref;
|
YRef = y_ref;
|
||||||
Count = count;
|
Count = count;
|
||||||
Offset = PosMod(offset, count);;
|
Offset = count ? PosMod(offset, count) : 0;
|
||||||
Stride = stride;
|
Stride = stride;
|
||||||
}
|
}
|
||||||
const T* Xs;
|
const T* Xs;
|
||||||
|
@ -2112,7 +2112,7 @@ struct GetterImVec2 {
|
||||||
GetterImVec2(const ImVec2* data, int count, int offset) {
|
GetterImVec2(const ImVec2* data, int count, int offset) {
|
||||||
Data = data;
|
Data = data;
|
||||||
Count = count;
|
Count = count;
|
||||||
Offset = PosMod(offset, count);
|
Offset = count ? PosMod(offset, count) : 0;
|
||||||
}
|
}
|
||||||
inline ImPlotPoint operator()(int idx) { return ImPlotPoint(Data[idx].x, Data[idx].y); }
|
inline ImPlotPoint operator()(int idx) { return ImPlotPoint(Data[idx].x, Data[idx].y); }
|
||||||
const ImVec2* Data;
|
const ImVec2* Data;
|
||||||
|
@ -2124,7 +2124,7 @@ struct GetterImPlotPoint {
|
||||||
GetterImPlotPoint(const ImPlotPoint* data, int count, int offset) {
|
GetterImPlotPoint(const ImPlotPoint* data, int count, int offset) {
|
||||||
Data = data;
|
Data = data;
|
||||||
Count = count;
|
Count = count;
|
||||||
Offset = PosMod(offset, count);
|
Offset = count ? PosMod(offset, count) : 0;
|
||||||
}
|
}
|
||||||
inline ImPlotPoint operator()(int idx) { return Data[idx]; }
|
inline ImPlotPoint operator()(int idx) { return Data[idx]; }
|
||||||
const ImPlotPoint* Data;
|
const ImPlotPoint* Data;
|
||||||
|
@ -2137,7 +2137,7 @@ struct GetterFuncPtrImPlotPoint {
|
||||||
getter = g;
|
getter = g;
|
||||||
Data = d;
|
Data = d;
|
||||||
Count = count;
|
Count = count;
|
||||||
Offset = PosMod(offset, count);
|
Offset = count ? PosMod(offset, count) : 0;
|
||||||
}
|
}
|
||||||
inline ImPlotPoint operator()(int idx) { return getter(Data, idx); }
|
inline ImPlotPoint operator()(int idx) { return getter(Data, idx); }
|
||||||
ImPlotPoint (*getter)(void* data, int idx);
|
ImPlotPoint (*getter)(void* data, int idx);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user