MCPcopy Create free account
hub / github.com/KDAB/KDChart / adjustLowerUpperRange

Method adjustLowerUpperRange

src/KDChart/KDChartAbstractGrid.cpp:79–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79void AbstractGrid::adjustLowerUpperRange(
80 qreal &start, qreal &end,
81 qreal stepWidth,
82 bool adjustLower, bool adjustUpper)
83{
84 const qreal startAdjust = (start >= 0.0) ? 0.0 : -1.0;
85 const qreal endAdjust = (end >= 0.0) ? 1.0 : 0.0;
86 if (adjustLower && !qFuzzyIsNull(fmod(start, stepWidth)))
87 start = stepWidth * (_trunc(start / stepWidth) + startAdjust);
88 if (adjustUpper && !qFuzzyIsNull(fmod(end, stepWidth)))
89 end = stepWidth * (_trunc(end / stepWidth) + endAdjust);
90}
91
92const DataDimension AbstractGrid::adjustedLowerUpperRange(
93 const DataDimension &dim,

Callers

nothing calls this directly

Calls 1

_truncFunction · 0.85

Tested by

no test coverage detected