MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / getPixelCoordinates

Method getPixelCoordinates

3rdparty/qcustomplot/qcustomplot.cpp:17408–17418  ·  view source on GitHub ↗

! \internal Returns the pixel coordinates of the data point at \a dataIndex, using \a interface1d to access the data points. */

Source from the content-addressed store, hash-verified

17406 the data points.
17407*/
17408QPointF QCPSelectionDecoratorBracket::getPixelCoordinates(const QCPPlottableInterface1D *interface1d, int dataIndex) const
17409{
17410 QCPAxis *keyAxis = mPlottable->keyAxis();
17411 QCPAxis *valueAxis = mPlottable->valueAxis();
17412 if (!keyAxis || !valueAxis) { qDebug() << Q_FUNC_INFO << "invalid key or value axis"; return {0, 0}; }
17413
17414 if (keyAxis->orientation() == Qt::Horizontal)
17415 return {keyAxis->coordToPixel(interface1d->dataMainKey(dataIndex)), valueAxis->coordToPixel(interface1d->dataMainValue(dataIndex))};
17416 else
17417 return {valueAxis->coordToPixel(interface1d->dataMainValue(dataIndex)), keyAxis->coordToPixel(interface1d->dataMainKey(dataIndex))};
17418}
17419/* end of 'src/selectiondecorator-bracket.cpp' */
17420
17421

Callers

nothing calls this directly

Calls 3

coordToPixelMethod · 0.80
dataMainKeyMethod · 0.45
dataMainValueMethod · 0.45

Tested by

no test coverage detected