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

Method coordsToPixels

3rdparty/qcustomplot/qcustomplot.cpp:11629–11644  ·  view source on GitHub ↗

! Convenience function for transforming a key/value pair to pixels on the QCustomPlot surface, taking the orientations of the axes associated with this plottable into account (e.g. whether key represents x or y). \a key and \a value are transformed to the coodinates in pixels and are written to \a x and \a y. \see pixelsToCoords, QCPAxis::coordToPixel */

Source from the content-addressed store, hash-verified

11627 \see pixelsToCoords, QCPAxis::coordToPixel
11628*/
11629void QCPAbstractPlottable::coordsToPixels(double key, double value, double &x, double &y) const
11630{
11631 QCPAxis *keyAxis = mKeyAxis.data();
11632 QCPAxis *valueAxis = mValueAxis.data();
11633 if (!keyAxis || !valueAxis) { qDebug() << Q_FUNC_INFO << "invalid key or value axis"; return; }
11634
11635 if (keyAxis->orientation() == Qt::Horizontal)
11636 {
11637 x = keyAxis->coordToPixel(key);
11638 y = valueAxis->coordToPixel(value);
11639 } else
11640 {
11641 y = keyAxis->coordToPixel(key);
11642 x = valueAxis->coordToPixel(value);
11643 }
11644}
11645
11646/*! \overload
11647

Callers

nothing calls this directly

Calls 2

coordToPixelMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected