MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / padDerivedRange

Method padDerivedRange

app/src/UI/Widgets/Plot.cpp:820–829  ·  view source on GitHub ↗

* @brief Pads a data-derived [min, max] range and rounds to integer bounds. */

Source from the content-addressed store, hash-verified

818 * @brief Pads a data-derived [min, max] range and rounds to integer bounds.
819 */
820void Widgets::Plot::padDerivedRange(double& min, double& max, const bool addPadding)
821{
822 applyAxisPadding(min, max, addPadding);
823 max = std::ceil(max);
824 min = std::floor(min);
825 if (DSP::almostEqual(max, min) && addPadding) {
826 min -= 1;
827 max += 1;
828 }
829}
830
831/**
832 * @brief Selects the padding strategy for a [min, max] pair before rounding.

Callers

nothing calls this directly

Calls 3

ceilFunction · 0.85
floorFunction · 0.85
almostEqualFunction · 0.85

Tested by

no test coverage detected