mirror of
https://github.com/gwm17/implot.git
synced 2024-11-23 02:38:53 -05:00
header cleanup
This commit is contained in:
parent
6f3f43c815
commit
d23bd30a44
2
implot.h
2
implot.h
|
@ -208,7 +208,7 @@ struct ImPlotLimits {
|
||||||
struct ImPlotStyle {
|
struct ImPlotStyle {
|
||||||
// item styling variables
|
// item styling variables
|
||||||
float LineWeight; // = 1, item line weight in pixels
|
float LineWeight; // = 1, item line weight in pixels
|
||||||
ImPlotMarker Marker; // = ImPlotMarker_None, marker specification
|
int Marker; // = ImPlotMarker_None, marker specification
|
||||||
float MarkerSize; // = 4, marker size in pixels (roughly the marker's "radius")
|
float MarkerSize; // = 4, marker size in pixels (roughly the marker's "radius")
|
||||||
float MarkerWeight; // = 1, outline weight of markers in pixels
|
float MarkerWeight; // = 1, outline weight of markers in pixels
|
||||||
float FillAlpha; // = 1, alpha modifier applied to plot fills
|
float FillAlpha; // = 1, alpha modifier applied to plot fills
|
||||||
|
|
|
@ -183,8 +183,8 @@ enum ImPlotTimeUnit_ {
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ImPlotTimeFmt_ {
|
enum ImPlotTimeFmt_ {
|
||||||
ImPlotTimeFmt_Us, // .428552
|
ImPlotTimeFmt_Us, // .428 552
|
||||||
ImPlotTimeFmt_SUs, // :29.428552
|
ImPlotTimeFmt_SUs, // :29.428 552
|
||||||
ImPlotTimeFmt_SMs, // :29.428
|
ImPlotTimeFmt_SMs, // :29.428
|
||||||
ImPlotTimeFmt_S, // :29
|
ImPlotTimeFmt_S, // :29
|
||||||
ImPlotTimeFmt_HrMinS, // 7:21:29pm
|
ImPlotTimeFmt_HrMinS, // 7:21:29pm
|
||||||
|
@ -579,21 +579,13 @@ struct ImPlotAxisScale
|
||||||
|
|
||||||
/// Two part time struct.
|
/// Two part time struct.
|
||||||
struct ImPlotTime {
|
struct ImPlotTime {
|
||||||
time_t S;
|
time_t S; // second part
|
||||||
int Us;
|
int Us; // microsecond part
|
||||||
ImPlotTime() { S = 0; Us = 0; }
|
ImPlotTime() { S = 0; Us = 0; }
|
||||||
ImPlotTime(time_t s, int us = 0) {
|
ImPlotTime(time_t s, int us = 0) { S = s + us / 1000000; Us = us % 1000000; }
|
||||||
S = s + us / 1000000;
|
void RollOver() { S = S + Us / 1000000; Us = Us % 1000000; }
|
||||||
Us = us % 1000000;
|
|
||||||
}
|
|
||||||
void RollOver() {
|
|
||||||
S = S + Us / 1000000;
|
|
||||||
Us = Us % 1000000;
|
|
||||||
}
|
|
||||||
static ImPlotTime FromDouble(double t) {
|
|
||||||
return ImPlotTime((time_t)t, (int)(t * 1000000 - floor(t) * 1000000));
|
|
||||||
}
|
|
||||||
double ToDouble() const { return (double)S + (double)Us / 1000000.0; }
|
double ToDouble() const { return (double)S + (double)Us / 1000000.0; }
|
||||||
|
static ImPlotTime FromDouble(double t) { return ImPlotTime((time_t)t, (int)(t * 1000000 - floor(t) * 1000000)); }
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline ImPlotTime operator+(const ImPlotTime& lhs, const ImPlotTime& rhs)
|
static inline ImPlotTime operator+(const ImPlotTime& lhs, const ImPlotTime& rhs)
|
||||||
|
@ -785,7 +777,7 @@ inline T OffsetAndStride(const T* data, int idx, int count, int offset, int stri
|
||||||
// Time Utils
|
// Time Utils
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
// NB: These functions only work if there is a currnet context because the
|
// NB: These functions only work if there is a current ImPlotContext because the
|
||||||
// internal tm struct is owned by the context!
|
// internal tm struct is owned by the context!
|
||||||
|
|
||||||
// Returns true if year is leap year (366 days long)
|
// Returns true if year is leap year (366 days long)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user