MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / getPixelSpacing

Method getPixelSpacing

3rdparty/qcustomplot/qcustomplot.cpp:24254–24276  ·  view source on GitHub ↗

! \internal Returns the spacing in pixels which is between this \a bars and the following one, both at the key coordinate \a keyCoord. \note Typically the returned value doesn't depend on \a bars or \a keyCoord. \a bars is only needed to get access to the key axis transformation and axis rect for the modes \ref stAxisRectRatio and \ref stPlotCoords. The \a keyCoord is only relevant

Source from the content-addressed store, hash-verified

24252 \ref stPlotCoords on a logarithmic axis.
24253*/
24254double QCPBarsGroup::getPixelSpacing(const QCPBars *bars, double keyCoord)
24255{
24256 switch (mSpacingType)
24257 {
24258 case stAbsolute:
24259 {
24260 return mSpacing;
24261 }
24262 case stAxisRectRatio:
24263 {
24264 if (bars->keyAxis()->orientation() == Qt::Horizontal)
24265 return bars->keyAxis()->axisRect()->width()*mSpacing;
24266 else
24267 return bars->keyAxis()->axisRect()->height()*mSpacing;
24268 }
24269 case stPlotCoords:
24270 {
24271 double keyPixel = bars->keyAxis()->coordToPixel(keyCoord);
24272 return qAbs(bars->keyAxis()->coordToPixel(keyCoord+mSpacing)-keyPixel);
24273 }
24274 }
24275 return 0;
24276}
24277
24278
24279////////////////////////////////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 2

axisRectMethod · 0.80
coordToPixelMethod · 0.80

Tested by

no test coverage detected