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

Method setScaleRatio

3rdparty/qcustomplot/qcustomplot.cpp:9193–9209  ·  view source on GitHub ↗

! Scales the range of this axis to have a certain scale \a ratio to \a otherAxis. The scaling will be done around the center of the current axis range. For example, if \a ratio is 1, this axis is the \a yAxis and \a otherAxis is \a xAxis, graphs plotted with those axes will appear in a 1:1 aspect ratio, independent of the aspect ratio the axis rect has. This is an operation that chan

Source from the content-addressed store, hash-verified

9191 will follow.
9192*/
9193void QCPAxis::setScaleRatio(const QCPAxis *otherAxis, double ratio)
9194{
9195 int otherPixelSize, ownPixelSize;
9196
9197 if (otherAxis->orientation() == Qt::Horizontal)
9198 otherPixelSize = otherAxis->axisRect()->width();
9199 else
9200 otherPixelSize = otherAxis->axisRect()->height();
9201
9202 if (orientation() == Qt::Horizontal)
9203 ownPixelSize = axisRect()->width();
9204 else
9205 ownPixelSize = axisRect()->height();
9206
9207 double newRangeSize = ratio*otherAxis->range().size()*ownPixelSize/double(otherPixelSize);
9208 setRange(range().center(), newRangeSize, Qt::AlignCenter);
9209}
9210
9211/*!
9212 Changes the axis range such that all plottables associated with this axis are fully visible in

Callers

nothing calls this directly

Calls 6

orientationFunction · 0.85
axisRectFunction · 0.85
axisRectMethod · 0.80
rangeFunction · 0.70
sizeMethod · 0.45
rangeMethod · 0.45

Tested by

no test coverage detected