MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / ceilToMultiple

Function ceilToMultiple

pj_widgets/src/Timeline.cpp:74–81  ·  view source on GitHub ↗

Smallest multiple of `interval` that is >= value (handles negatives exactly, no double precision loss at epoch scale).

Source from the content-addressed store, hash-verified

72// Smallest multiple of `interval` that is >= value (handles negatives exactly,
73// no double precision loss at epoch scale).
74qint64 ceilToMultiple(qint64 value, qint64 interval) noexcept {
75 const qint64 q = value / interval; // truncates toward zero
76 const qint64 floored = q * interval;
77 if (floored == value) {
78 return value;
79 }
80 return (value > 0) ? floored + interval : floored;
81}
82} // namespace
83
84void TimelineScene::setTracks(std::vector<TimelineSpanInput> tracks) {

Callers 1

rulerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected