MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / FloorTime

Function FloorTime

Source/3rdParty/implot/implot.cpp:1063–1078  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1061}
1062
1063ImPlotTime FloorTime(const ImPlotTime& t, ImPlotTimeUnit unit) {
1064 ImPlotContext& gp = *GImPlot;
1065 GetTime(t, &gp.Tm);
1066 switch (unit) {
1067 case ImPlotTimeUnit_S: return ImPlotTime(t.S, 0);
1068 case ImPlotTimeUnit_Ms: return ImPlotTime(t.S, (t.Us / 1000) * 1000);
1069 case ImPlotTimeUnit_Us: return t;
1070 case ImPlotTimeUnit_Yr: gp.Tm.tm_mon = 0; // fall-through
1071 case ImPlotTimeUnit_Mo: gp.Tm.tm_mday = 1; // fall-through
1072 case ImPlotTimeUnit_Day: gp.Tm.tm_hour = 0; // fall-through
1073 case ImPlotTimeUnit_Hr: gp.Tm.tm_min = 0; // fall-through
1074 case ImPlotTimeUnit_Min: gp.Tm.tm_sec = 0; break;
1075 default: return t;
1076 }
1077 return MkTime(&gp.Tm);
1078}
1079
1080ImPlotTime CeilTime(const ImPlotTime& t, ImPlotTimeUnit unit) {
1081 return AddTime(FloorTime(t, unit), unit, 1);

Callers 5

CeilTimeFunction · 0.85
RoundTimeFunction · 0.85
Locator_TimeFunction · 0.85
ShowDatePickerFunction · 0.85
TodayFunction · 0.85

Calls 3

ImPlotTimeClass · 0.85
MkTimeFunction · 0.85
GetTimeFunction · 0.70

Tested by

no test coverage detected